Unwanted window spawns when using Tkinter with multiprocessing.

Dave Angel davea at davea.name
Sun Apr 28 20:24:22 EDT 2013


On 04/28/2013 07:40 PM, alternative00 at rocketmail.com wrote:
> Well I saw this clause on most of the multiprocessing examples I saw but the reason it was here wasn't explained so I just ignored it (yeah stupid I know). I don't think I bypassed anything,

Yes, you skipped the essential if clause.

The child process is started with a different  __name__.  So if the 
__name__ is not "__main__", then you should NOT call any of the GUI 
startup code.

Probably you should do little or nothing in the top-level code of the 
child process.  But we can't give specific advice without seeing what 
that code now looks like.  What code do you have at top level, and if it 
calls functions, what do they look like?

The way you get that code to be different in the child is with that if 
statement that you omitted.

> at least not on purpose. I'm running on Windows 7  64 bits.
>


-- 
DaveA



More information about the Python-list mailing list