thread already started...

S

sarmin kho

Hi Pythoners...

I am building a python GUI with wxpython... the python GUI will periodically call a python module written on python 2.2... wxtimer is used to enable the periodic call... it works fine when i first run the wxtimer to periodically call the python module... the problem arises when i stop the wxtimer and restart the wxtimer (restart calling periodically)...

It says : "thread already started"... the python module i called is written by other programmer and threads must have been started somewhere in the python module... if i exit from the python GUI, all threads will be stopped...

i suppose the quick solution is to stop all threads when the wxtimer is stopped...

ANY IDEA ON HOW TO STOP ALL THREADS INDEFINITELY WITHOUT CLOSING THE GUI??... python command 'sys.exit()' will exit from my main running code (the python GUI)...

Many thanks to Pythoners... I have just been introduced to python few months ago and i have now fallen in love with it...

regards
sarmin
 
J

Jarek Zgoda

sarmin kho said:
ANY IDEA ON HOW TO STOP ALL THREADS INDEFINITELY WITHOUT CLOSING THE
GUI??... python command 'sys.exit()' will exit from my main running
code (the python GUI)...

I don't think it's possible. And even if it is possible, this would be a
bad idea, since threads may access and change some data -- forcing them
to terminate could wreak havoc on this data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top