Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows+Python: Why is the first opened window not shown active?
    primarykey
    data
    text
    <p>I have found a very strange problem about using the python scripts under Python Windows command line prompt, to reproduce this issue, you can simply do those steps:</p> <ol> <li>start a Python command line prompt(this is usually to hit the Start Menu->Python 2.7->Python(command line). </li> <li><p>type the following text, and hit Enter key.</p> <pre><code>import ctypes </code></pre></li> <li><p>type the following text, and hit Enter key.</p> <pre><code>ctypes.windll.user32.MessageBoxA(0, "Your text", "Your title", 1) </code></pre></li> <li>You will see a message box opened, but this message box window is not activated. </li> <li>Use the mouse to click on the icon of the message box in task bar to activate the message box </li> <li>Close the message box </li> <li><p>type the text again in the Python prompt shell</p> <pre><code>ctypes.windll.user32.MessageBoxA(0, "Your text", "Your title", 1) </code></pre></li> <li>Now, the message box is showed activated (the expected behavior) </li> </ol> <p>So, my question is, why the first message box(window) is not shown active? I originally find this issue when I run a Python pretty printer under GDB command line, because I want to use some python pretty printer to visual the data, like this <a href="https://stackoverflow.com/questions/16227166/gdb-cvmat-python-object-issue-when-debugging-a-c-program">GDB cv::Mat python object issue when debugging a c++ program</a>, I need to show the OpenCV Image window immediately after I type the plot command.</p> <p>But later I found that this is an issue related to Python itself.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload