【发布时间】:2020-06-10 20:43:52
【问题描述】:
我想实现一个 python 函数来执行一个 bash 命令。 例如:
def run_command():
# run 'python test --a' command
【问题讨论】:
-
你做过任何研究吗?
-
您可能希望/需要确保 Bash 运行它,例如
bash -c 'python test --a',具体取决于您选择的方法(请参阅副本)
标签: python bash command-line