python多線程方式執行多個bat的代碼,感興趣的朋友可以參考下。
import threadingfrom win32api import *class MyThread(threading.Thread): def __init__(self, bat_path, **kwargs): threading.Thread.__init__(self, **kwargs) self.bat_path = bat_path def run(self): ShellExecute(0, None, self.bat_path, None, "c:", True) for i in range(1,4): t = MyThread("c: est" + str(i) + ".bat") t.start()以上就是本文的全部內容,希望對大家學習python程序設計有所幫助。
|
新聞熱點
疑難解答
圖片精選