繁体   English   中英

如何使用批处理文件同时运行多个python脚本

[英]How to use batch file to run multiple python scripts simultaneously

我有很多python脚本,单击它们分别运行每个脚本是很痛苦的。 如何制作一个批处理文件以一次全部运行?

只需像这样的脚本将每个任务作为背景(在Windows上):

start /B python script1.py
start /B python script2.py
start /B python script3.py

在* nix上:

python script1.py &
python script2.py &
python script3.py &

假设非您的脚本需要人工干预才能运行

使用start命令启动一个过程。

@echo off
start "" foo.py
start "" bar.py
start "" baz.py

重新评论:“有没有办法将这些最小化?”

您总是可以通过键入命令名称后跟/?来询问命令的工作方式/? 在这种情况下,请start /? 告诉我们其命令行选项包括:

MIN          Start window minimized.

因此,要最小化启动应用程序,请使用:

start "" /MIN quux.py

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM