I was trying to make a \"game\" in Python where the user inputs a command. However, I do not know whether you can take that input to be a function name. This is my current e
Have a look at the cmd
module. See this.
It is normally used for shell style comman dlanguages, but it can also be used to create simple text style adventure games.
You can create commands by creating a new method on the Cmd
subclass.
E.g.
def do_move(self, args):
if self.next_room.has_snake():
print "The next room contains a poisonous snake. It bites you and you die."
else:
print "The room is empty"