我的代码只有几行:
print("python kaldigstserver client.py -r 32000 ",self.filename,file=open("output.txt", "a"))
with open('output.txt') as my_file:
file_text = my_file.read()
print(file_text)
subprocess.Popen(args=["gnome-terminal", "--working-directory=/home/huma/G-str/kaldi-gstreamer-server"])
这会在我执行python程序时打开一个终端……但我想把命令从文本文件重定向到终端…即output.txt。自动执行。
我不知道怎么做。我用“--command”&“-execute”尝试过,但它不起作用。有办法吗?????
提前谢谢。