目前我的代码有点麻烦。我正在制作一个非常基本的 RPG,并且遇到了这个问题:(未绑定的方法 wrongCommand.wrong)我也在运行 python 2.7.5 和 windows 7。
这是我的代码:
import os
class wrongCommand():
def wrong():
os.system("cls")
print "Sorry, the command that you entered is invalid."
print "Please try again."
def main():
print "Welcome to the game!"
print "What do you want to do?"
print "1.) Start game"
print "2.) More information/Credits"
print "3.) Exit the game"
mm = raw_input("> ")
if mm != "1" and mm != "2" and mm != "3":
print wrongCommand.wrong
main();
main()