当我使用命令来终止程序,它并没有终止,而是假定我想,当我说“不” 这里是我的代码来打开另一个程序:我的Python程序不会正确终止?
import getpass
print 'Hello', getpass.getuser(), ', welcome!'
do = raw_input ('What program would you like to open? ')
if do.lower() == 'browser' or 'internet' or 'Chrome' or 'Google chrome':
import webbrowser
webbrowser.open ('www.google.com')
oth = raw_input ('Are there any others? ')
if oth.lower() == 'yes' or 'ye' or 'yeah':
oth2 = raw_input ('Please name the program you would like to open! ')
else:
import sys
sys.exit()
在选项的“元组”中; ^) – mgilson 2012-07-12 14:58:29