wxpython多线程,可解决进度条在程序后台运行时不动的情况
在前面先定义myThread类import threadingclass myThread(threading.Thread):def __init__(self, command):threading.Thread.__init__(self)self.cmd = commanddef run(self):print"Starting" + self.cmdos.system(self.cmd)
·
在前面先定义myThread类
import threading
class myThread(threading.Thread):
def __init__(self, command):
threading.Thread.__init__(self)
self.cmd = command
def run(self):
print"Starting" + self.cmd
os.system(self.cmd)
print"Exiting" + self.cmd
使用:
thread1 = myThread('python daily_report_GUI.py')
# thread2 = ...
thread1.start()
# thread2.start()
更多推荐
所有评论(0)