現在、私のコードに少し問題があります。私は非常に基本的な RPG を作成していますが、この問題に遭遇しました: (unbound method 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()