首页 > 编程 > Python > 正文

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

2019-11-25 16:45:06
字体:
来源:转载
供稿:网友

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程序设计有所帮助。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表