Bonjour à tous,

Voila, j'ai un petit pb avec les thread, je n'arrive pas a les lancer correctement.
Voici mon code (très simplifié):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
import wx
import threading
 
class mainFrame(wx.Frame):
    def __init__(self, parent, id, title, param):
        #initialisation de l'interface graphique
 
    def OnSelectFile(self, event):
        #selection d'un fichier a uploader
 
    def OnStart(self, event):
        #lancement du thread de travail
        a = threading.Thread(None, Upload, None, (self.tc.GetValue(), self))
        a.start()
 
    def OnExit(self, event):
        self.Close()
 
class ShowFrame():
    def __init__(self, parent):
        app = wx.App()
        MainWindow = mainFrame(None, -1, 'Uploader', parent)
        app.MainLoop()
 
class Upload(threading.Thread):
    def __init__(self, fichierpath, frame):
        threading.Thread.__init__(self)
        print "upload"
        frame.Gt.SetLabel("Upload en cours...")
        return 1
la fonction "upload" ne se lance pas,
Aurriez vous une idée du pourquoi du comment ?
Merci =)