我在脚本中有两个函数,如:
def a(): 打印
def b(): 打印b
如何决定用户是否运行'b'功能? 谢谢你的提前
答案 0 :(得分:0)
#At starting of script take the username as input
name = raw_input("Enter Your Name : ")
name.lower() #To make input name lowercase
if name == 'bob': #name for which you have to call b
b()
else:
a()