简体   繁体   English

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

[英]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.

相关问题 同时运行多个python脚本,它们同时使用用户输入和while循环 - Run multiple python scripts, that use user inputs and while loops, simultaneously 如何同时运行多个无限循环的Python脚本 - How to run multiple infinitely looping Python scripts simultaneously 从 PHP 同时运行多个 Python 脚本 - Run multiple Python scripts simultaneously from PHP 批处理依次运行多个链接的 python 脚本,但找不到 NumPy 模块,也无法使用其他文件结果 - batch to run multiple linked python scripts sequentially, and no NumPy module found, also cannot use another file results 如何同时运行和破坏两个 python 脚本? - How to run and break two python scripts simultaneously? 如何在窗口xp / 7中从批处理文件调用/运行多个python脚本 - how to call / run multiple python scripts from batch file in window xp / 7 如何以最大化 CPU 使用率的方式从包装器脚本同时运行多个 python 脚本? - How to run multiple python scripts simultaneously from a wrapper script in such a way that CPU utilization is maximized? 如何从主脚本同时运行两个 python 脚本 - How to run two python scripts simultaneously from a master script 如何在 Python 中同时运行多个循环? - How to run multiple loops simultaneously in Python? 如何同时运行多个python文件? - How to run multiple python files simultaneously?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM