Python プログラムがあり、他の Python クラスをインポートしようとしていますが、NameError が発生します。
Traceback (most recent call last):
File "run.py", line 3, in <module>
f = wow('fgd')
NameError: name 'wow' is not defined
これは、次のファイルにありますnew.py
。
class wow(object):
def __init__(self, start):
self.start = start
def go(self):
print "test test test"
f = raw_input("> ")
if f == "test":
print "!!"
return c.vov()
else:
print "nope"
return f.go()
class joj(object):
def __init__(self, start):
self.start = start
def vov(self):
print " !!!!! "
これはファイルにありますrun.py
:
from new import *
f = wow('fgd')
c = joj('fds')
f.go()
私は何を間違っていますか?