我对编程和python非常陌生。我正在编写脚本,如果客户输入空格,我想退出脚本。 问题是我该怎么做对不对? 这是我的尝试,但我认为是错误的如何检查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