我是靠谱客的博主 含糊鸭子,这篇文章主要介绍linux 运行多个python,现在分享给大家,希望可以做个参考。

1. 命令行执行 python test1.py & python test2.py & python test3.py

2. 创建run.py

import os
 
os.system("python ./test1.py")
os.system("python ./test2.py")
os.system("python ./test3.py")
执行 python run.py

3. 创建 run.sh

#!/bin/sh
python test1.py >/dev/null 2>&1
python test2.py >/dev/null 2>&1
python test3.py >/dev/null 2>&1
赋予sh脚本可执行权限  chmod -x run.sh

执行 sh run.sh
 

最后

以上就是含糊鸭子最近收集整理的关于linux 运行多个python的全部内容,更多相关linux内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(116)

评论列表共有 0 条评论

立即
投稿
返回
顶部