for item in testfiles:
#subprocess.call("python ..\\TestCases\\" + str(item).replace("\\n", ""), shell=True)
print "修改前:" + os.getcwd()
os.chdir('/Users/yirong/PycharmProjects/CloudResWebTest/TestCases')
print "修改后:" + os.getcwd()
#这样子报错,我将command打印出来也是python TC_Search_Python.py
command="python "+str(item)
#这样子执行正常
#command="python TC_Search_Python.py"
print command
subprocess.call(command,shell=True)
http://www.jb51.net/article/95444.htm
没有报错,不知道你那边报的什么错误信息