如何通过使用easygui选择测试,一个接一个地运行python脚本?
我正在使用下面的代码一个接一个地选择要运行的测试如何通过使用easygui选择测试,一个接一个地运行python脚本?,python,runtime-error,main,easygui,execfile,Python,Runtime Error,Main,Easygui,Execfile,我正在使用下面的代码一个接一个地选择要运行的测试 from easygui import * import sys,os msg="Select following tests for testing" title="Test Selector" choices=["Test_case","Test_case2"] choice=multchoicebox(msg,title,choices) print choice msgbox("You have selected:"+str(cho
from easygui import *
import sys,os
msg="Select following tests for testing"
title="Test Selector"
choices=["Test_case","Test_case2"]
choice=multchoicebox(msg,title,choices)
print choice
msgbox("You have selected:"+str(choice))
msg="Do you want to continue?"
title="Please confirm"
if ccbox(msg,title):
pass
else:
sys.exit(0)
def func():
for tests in choice:
print "tests",tests
return tests
def main():
execfile('python'+' ' +str( func())+'.py')
main()
现在,在选择测试之后,我想一个接一个地运行这些测试
IOError:[Errno 2]没有这样的文件或目录:“python Test\u case.py”
有人能帮我吗?您不需要将
'python'
传递给文件名
execfile('Test_case.py') # willl work
还是你的情况
execfile(str( func())+'.py')
看这里:
“python”+”
tmp=importlib.import_模块(测试)如果我尝试使用它,它只运行第一个脚本,我如何让它运行所有脚本?如果我选择多个测试,它会尝试一个接一个地执行两个python脚本吗?