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,"c:",True)
  
for i in range(1,4):
  t = MyThread("c: est" + str(i) + ".bat")
  t.start()

以上就是本文的全部内容,希望对大家学习python程序设计有所帮助。

相关文章

使用爬虫利器 Playwright,轻松爬取抖查查数据 我们先分析登...
轻松爬取灰豚数据的抖音商品数据 调用两次登录接口实现模拟登...
成功绕过阿里无痕验证码,一键爬取飞瓜数据 飞瓜数据的登录接...
一文教你从零开始入门蝉妈妈数据爬取,成功逆向破解数据加密...
抽丝剥茧成功破解红人点集的签名加密算法 抽丝剥茧破解登录签...
轻松绕过 Graphql 接口爬取有米有数的商品数据 有米有数数据...