手机
当前位置:查字典教程网 >脚本专栏 >python >python多线程方式执行多个bat代码
python多线程方式执行多个bat代码
摘要:python多线程方式执行多个bat的代码,感兴趣的朋友可以参考下。importthreadingfromwin32apiimport*cl...

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代码】相关文章:

python解析xml模块封装代码

python实现html转ubb代码(html2ubb)

python线程池的实现实例

python写的ARP攻击代码实例

python切换hosts文件代码示例

python实现的解析crontab配置文件代码

python将人民币转换大写的脚本代码

python开发的小球完全弹性碰撞游戏代码

python多线程抓取天涯帖子内容示例

python练习程序批量修改文件名

精品推荐
分类导航