Unwanted window spawns when using Tkinter with multiprocessing.

Dave Angel davea at davea.name
Mon Apr 29 22:05:17 EDT 2013


On 04/29/2013 09:17 PM, alternative00 at rocketmail.com wrote:
> I thought 'clause' was reffering to the 'if __name__ == "__main__":' thing in English, but apparently not.
> Well except the import and the 'globalization' of my variables, every thing is idented.
>

No clue whom you think you're replying to, but all your replies so far 
are appearing in the thread as replies to your OP.  Please use a little 
context from the message you think you're responding to, so we have an 
idea what you're talking about.

Did you ever see MRAB's message, where he told you exactly what the 
change requested was?


if __name__ == "__main__":
     # This part will be run if the file is run as the main script.
     #
     # The multiprocessing module will import this file to run the
     # "player" function, but __name__ won't be "__main__" when it does
     # so, therefore this bit of code won't be run.

     #Initialisation
     fenetre = Tk()
     frame = Frame(fenetre, width=200, height=100)
     instance = 'Instance'

     #TK
     frame.focus_set()
     frame.bind("<Key>", key)
     frame.pack()
     fenetre.mainloop()

All of those lines were at the left margin in your earlier posted code, 
and you give us no reason to expect you've made them conditional.

-- 
DaveA



More information about the Python-list mailing list