我有一个python脚本,收到以下错误:
Traceback (most recent call last):
File "C:\Users\Tim\Desktop\pop-erp\test.py", line 1, in <module>
s = Something()
NameError: name 'Something' is not defined
以下是导致问题的代码:
s = Something()
s.out()
class Something:
def out():
print("it works")
这是在Windows 7 x86-64下使用Python 3.3.0运行的.
为什么找不到Something
班?