【发布时间】:2011-02-02 22:35:19
【问题描述】:
我正在使用下面的示例:
APT command line interface-like yes/no input?
我想按照概述将其定义为自己的定义,然后按需调用它,如下所示:
def log_manager():
question = "Do you wish to continue?"
choice = query_yes_no_quit(question, default="yes")
if choice == 'y':
print ("you entered y")
else:
print ("not working")
无论我输入什么,总是会打印“不工作”。任何指导将不胜感激!
【问题讨论】:
-
query_yes_no_quit()函数的返回值是多少,choice?请打印出来并更新您的问题。