Hello everybody,

I'm writing a small interface with python 2.6.5 and pyqt 4.7.3.

I'm testing this interface on windows, but i have the same problem in linux 
(windows and linux are 32-bit OS).

So... This is my problem:

In my interface i have 1 qpushbutton (self.Button) and 2 QLineEdit (Edit1, and 
edit2)

i connected qpushbutton with a funzion (pressbutton)

def pressbutton(self):
     self.thread = threading.Thread( target=self.Thcall )
     self.thread.start()

def Thcall(self):
        while(True):    
            self.t = Timer(10, self.Read) #10 seconds
            self.t.start()
            self.t.join()

def Read(self):
        Edit1.setText("a string")
        Edit2.setText("another string")
        #now here i have 500 linees of code, i read from serial port and 
compute these datas. It's take about 500ms
        Edit1.setText("finished")
        Edit2.setText("finished")



as you can see my program is very simple (i omitted the first part, where i 
initialize Qwidget and move them in my window). But when my program enter in 
self.Read my windows freeze for some time (< 1 second). This is the first 
problem. Why it freeze?

Second problem: If i switch from antoher program (for example firefox) and my 
program, this crash....

Is there some error in my code?

i want that when user push a button, my program will call function Read every 
10 seconds FOREVER....

Thank you very much and sorry for my bad english




      
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to