源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-08-29 05:24 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要: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程序设计有所帮助。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部