在 Python 中运行终端脚本

时间:2021-07-23 03:01:15

标签: python macos terminal

我知道如何run a Python script in the terminal。 相反,如何在 Python 脚本中运行终端脚本?

我想在终端中运行 file.py 并让它在新的终端窗口上执行命令。

def run_in_terminal(command):
    need code here that opens the terminal and runs command in terminal


terminal_script = some command to run in terminal
run_in_terminal(terminal_script)

0 个答案:

没有答案