def dotask():
print "Task done..."
def returnvalue():
return "Awesome"
cmd = raw_input("Your command: ")
eval(cmd + "()")
I know that you can't use eval to assign a value to a variable. but is it the best way to have user input be performing a function?
For example:
I put "dotask" in raw input, it will print "Task done..."