我正在尝试从 python 代码中运行一个 C 程序。
cmd = 'gnome-terminal --command=./myprog' subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
代码执行,终端关闭。
我想在执行完成后保持终端打开,而不必在 C 文件中添加任何额外的代码,例如提示用户输入一些内容。
有解决方法吗?
terminal gnome c
c ×1
gnome ×1
terminal ×1