Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > python入门

python多线程方式执行多个bat代码

来源:中文源码网    浏览:123 次    日期:2024-05-06 20:21:47
【下载文档:  python多线程方式执行多个bat代码.txt 】


python多线程方式执行多个bat代码
python多线程方式执行多个bat的代码,感兴趣的朋友可以参考下。
import threading
from 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程序设计有所帮助。

相关内容