【发布时间】:2019-02-28 11:29:17
【问题描述】:
我想在我的笔记本电脑上同时运行两个 python 脚本,而不会降低它们的计算速度。
我搜索并看到this question 说我们应该使用bash 文件。
我已经搜索过,但我不明白我应该做什么以及如何使用这种称为bash 的方式运行这些脚本。
python script1.py &
python script2.py &
我对此缺乏经验,需要您的专业建议。 我不明白如何做到这一点,在哪里以及如何做到这一点。 我使用的是 Windows 64 位。
最好的
PS: The answer I checked the mark is a way to run in parallel two tasks, but it does not decrease the calculation time for two parallel tasks at all.
【问题讨论】:
-
你的操作系统是什么?
-
打开一个终端并运行命令
python script1.py &python script2.py &(基于ubuntu /linux的系统)您将能够运行脚本而不会影响其他性能 -
@quamrana 窗口
-
@prashantrana 我正在使用 Windows。所以只需要在命令提示符下写
python script1.py & python script2.py &?一切都会正确吗? -
@MaY 是的,它会做到的,我的意思是运行
python script1.py &点击回车然后在终端运行python script2.py &