Unwanted window spawns when using Tkinter with multiprocessing.
alternative00 at rocketmail.com
alternative00 at rocketmail.com
Sun Apr 28 18:23:21 EDT 2013
Sorry for my bad english.
Here's my code :
def key(event):
instance = 'Instance'
touche = event.char
instance = multiprocessing.Process(target=player, args=(hitkey,))
instance.start()
def player(hitkey):
winsound.PlaySound(hitkey + '.wav', winsound.SND_FILENAME|winsound.SND_NOWAIT|winsound.SND_ASYNC)
'key' is the tkinter function wich gets the pressed key.
'player' is the function playing a specific wav file depending on wich key is pressed, that's why its argument is 'hitkey'. It uses the winsound module.
What spawns new windows is theorically the multiprocessing line of code, even if it's inside the 'key' function.
More information about the Python-list
mailing list