我试图使用导入功能在另一个程序中运行程序。然而,它运行,它绕过我的功能,只运行其他程序。
import ex35
def beginning():
print "you have three door choices. door a,b,c"
door=raw_input("> ")
if door=="c":
ex35.start(door)
elif door=="a":
print "do i have to put stuff down?"
else:
print "i finally got it to work"
beginning()
if __name__ == "__main__":
# stuff only to run when not called via 'import' here
main()
答案 0 :(得分:0)
def start(): 打印“你有三个门选择。门a,b,c” door = raw_input(“>”)
if door=="c":
import ex35
elif door=="a":
import ex1
else:
import ex2
开始()