这篇文章主要为大家详细介绍了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程序设计有所帮助。
更多python多线程方式执行多个bat相关文章请关注PHP中文网!
立即学习“Python免费学习笔记(深入)”;
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号