import os
from threading import Thread
from multiprocessing import Process
import subprocess
def func():
# os.system("python ./test2.py")
# os.system("gnome-terminal -e 'bash -c \"ls; exec bash\"'")
# subprocess.call_in_new_window('python ./test2.py', shell=True)
# subprocess.call(['gnome-terminal', '-x', 'python ./test2.py'])
subprocess.call('python ./test2.py', creationflags=subprocess.CREATE_NEW_CONSOLE)
if __name__ == '__main__':
# t = Thread(target=func)
# t.start()
p = Process(target=func)
p.start()
windows中一个python脚本中打开一个新的cmd终端执行另一个脚本
最新推荐文章于 2023-05-26 17:48:41 发布