calling class from an external module causes NameError, in IDLE it works fine

落爺英雄遲暮 提交于 2019-12-06 07:57:31

You're using python-2.x when running your testclass.py file. Your code, however, seems to be written for python-3.x version. In python-2.x you need to use raw_input functions for the same purpose you would use input in python-3.x. You could run

$ python --version

To find out what exactly version you're using by default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!