我一直在尝试为Super Hexagon运行一个机器人(只是为了好玩),但当我尝试在IDLE 2.7.11(32位)中运行模块时,我收到了错误
Traceback (most recent call last):\
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line 223, in <module>
main()
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line 219, in main
logic.start()
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line >
183, in start
wall_list = self.hexagon.get_walls()
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line
77, in get_walls
num_walls = self.get_num_walls()
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line 119, in get_num_walls
num_walls = self.memory.read(self.app_base + offset)
File "C:\Users\Spencer\Desktop\Super-Hexagon-Bot\super_hexagon_bot.py", line 35, in read
value = int.from_bytes(self.buffer.value, byteorder=byteorder)
AttributeError: type object 'int' has no attribute 'from_bytes'
如果您想查看我正在尝试运行的代码,请点击http://pastebin.com/X34Qxrxx
答案 0 :(得分:0)
此代码适用于Python 3.它不能在Python 2中运行。