Unwanted window spawns when using Tkinter with multiprocessing.

alternative00 at rocketmail.com alternative00 at rocketmail.com
Mon Apr 29 11:31:50 EDT 2013


My full code is : 


#Import
from tkinter import *
import wave
import winsound
import multiprocessing

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


#Fonctions

def key(event):
   
    instance = 'Instance'
    hitkey = 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)
    
    
     
#TK
frame.focus_set()
frame.bind("<Key>", key)
frame.pack()
fenetre.mainloop()

The problem is that I don't know where to put that clause.



More information about the Python-list mailing list