Thread: AttributeError: 'module' object has no attribute 'MyStuffx'
would know how resolve errors?code:#file script.py #file "/home/test/documents/cript.py" import myclass01 import myclass02 import mystuff mc = myclass01.myclass1() print "what\'s " + mc.x + "?" print "how this? ", mc.printsomething() mc2 = myclass02.myclass2() print "this ", mc2.printsomething() # mystuff module. contains class mystuffx. # class contains method apple #from mystuff import apple # not work #print "this apple ", apple() # # file "/home/test/documents/script.py" ms = mystuff.mystuffx() print "this apple ",ms.apple #-------------------------------------------------------// # file "/home/test/documents/pymodules/mystuff.py" class mystuffx: # (object): how works, knows? def __init__(self): self.tangerine = 'and thousand years between' def apple(self): print 'i classy apples!' #-------------------------------------------------------// # file "/home/test/documents/pymodules/myclass01.py" class myclass1: def __init__(self): self.x = 'c1' def printsomething(self): print 'hey' #-------------------------------------------------------// # file "/home/test/documents/pymodules/myclass02.py" class myclass2: def __init__(self): self.x = 'c2' def printsomething(self): print 'crap2' #-------------------------------------------------------// # errors getting 'import sitecustomize' failed; use -v traceback what's c1? how this? hey none crap2 none traceback (most recent call last): file "/home/peshone/documents/script.py", line 42, in <module> ms = mystuff.mystuffx() attributeerror: 'module' object has no attribute 'mystuffx'
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [lubuntu] AttributeError: 'module' object has no attribute 'MyStuffx'
Ubuntu
Comments
Post a Comment