[英]How to use batch file to run multiple python scripts simultaneously
I have many python scripts and it is a pain to run each one of them individually by clicking them. 我有很多python脚本,单击它们分别运行每个脚本是很痛苦的。 How to make a batch file to run them all at once?
如何制作一个批处理文件以一次全部运行?
just make a script like this backgrounding each task (on windows): 只需像这样的脚本将每个任务作为背景(在Windows上):
start /B python script1.py
start /B python script2.py
start /B python script3.py
on *nix: 在* nix上:
python script1.py &
python script2.py &
python script3.py &
Assuming non of your script requires human interaction to run 假设非您的脚本需要人工干预才能运行
Use the start
command to initiate a process. 使用
start
命令启动一个过程。
@echo off
start "" foo.py
start "" bar.py
start "" baz.py
Re comment: “is there way to start these minimized?” 重新评论:“有没有办法将这些最小化?”
You can always ask about how a command works by typing the command name followed by a /?
您总是可以通过键入命令名称后跟
/?
来询问命令的工作方式/?
. 。 In this case,
start /?
在这种情况下,请
start /?
tells us its command-line options include: 告诉我们其命令行选项包括:
MIN Start window minimized.
Hence, to start the application minimized, use: 因此,要最小化启动应用程序,请使用:
start "" /MIN quux.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.