Python NameError from contents of a variable

前端 未结 2 1162
慢半拍i
慢半拍i 2021-01-25 01:50

I\'ve been making a mod for the Raspberry Pi version of Minecraft and I\'m getting a very frustrating error every time I enter one of the commands in my program. Here\'s my code

2条回答
  •  醉话见心
    2021-01-25 02:17

    when you use the input() to input the newBlock , the parser regards the newBlock as the variable instead of string. so you need to use raw_input

    see the ref of the input()

    def input(prompt):
        return (eval(raw_input(prompt)))
    

提交回复
热议问题