我用pythonqt
设计接口,当我试图用os.system
调用我的程序时,接口冻结。在
def pairClicked(self,exp1,exp2):
os.system("""cd kat
./run -v pair""") #in the terminal i used to call my python interface, it runs this commands
os.system(exp1+" "+expr2) #but here nothing happens
一旦我终止了程序,终端会说(在exp1=t1
和{
对我做错了什么有什么想法/建议吗? 请注意,这是我第一次做这种事。在
编辑:
我编辑并使用了这段代码
p=subprocess.Popen(['cd','kat','./run', '-pair', str(test.__len__()),expr1Text,expr2Text],stdout=subprocess.PIPE,shell=True)
out= p.communicate()
print(out)
但它正在返回('',None)
。
我想问题是我使用了cd kat ./run -pair *len* expr1 expr2
这样的命令,而不是:
cd kat
./run -pair *len*
expr1
expr2
如何使用子流程生成新行?在
听起来像是。/跑步被挡住了。在
您可能需要生成一个异步子进程或使用另一个线程,这样您的GUI可以在./run运行时继续工作。在
相关问题 更多 >
编程相关推荐