2
我设计使用pythonqt
的接口,当我尝试使用os.system
,接口冻结打电话给我的程序。Python的OS故障
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
和exp2=t2
情况下):
sh 1: t1 not found
sh 2: t2 not found
任何IDEIA /什么IAM做错了建议吗? 请注意,这是我第一次做这类事情。
编辑:
我已经编辑和使用这段代码,而不是
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
代替:
如何使用子进程作出新的生产线?
'run'是什么? – Blender 2013-04-29 02:25:36