【发布时间】:2012-03-27 18:52:56
【问题描述】:
我对编程和 python 非常陌生。我正在编写脚本,如果客户键入空格,我想退出脚本。 问题是我该怎么做? 这是我的尝试,但我认为是错误的
例如
userType = raw_input('Please enter the phrase to look: ')
userType = userType.strip()
line = inf.readline()
while (userType == raw_input)
print "userType\n"
if (userType == "")
print "invalid entry, the program will terminate"
# some code to close the app
【问题讨论】: