Dennis Lee Bieber wrote: > On 10 Apr 2006 20:55:31 -0700, "placid" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > > Traceback (most recent call last): > > File "LinkedList.py", line 7, in ? > > main() > > File "LinkedList.py", line 4, in main > > n = Node("test") > > NameError: global name 'Node' is not defined > > > That is NOT the same code as you posted. > > You posted: > import sys > import node > > def main(): > print "Does nothin ATM, as it doesnt work" > > main() > > Line 4 of that is "def main():" > > If you have any .pyc or .pyo files in the same directory as your > source, delete them, try again, and show us what happened. > > BTW: as for the code that is being run... IT NEEDS > > n = node.Node("test") > > You imported a module "node", but the class definition named "Node" > is INSIDE the module -- so you have to specify > module.class > to access it... > -- > > ============================================================== < > > [EMAIL PROTECTED] | Wulfraed Dennis Lee Bieber KD6MOG < > > [EMAIL PROTECTED] | Bestiaria Support Staff < > > ============================================================== < > > Home Page: <http://www.dm.net/~wulfraed/> < > > Overflow Page: <http://wlfraed.home.netcom.com/> <
Sorry, i left some code out, my bad, LinkedList.py contains (well it doesnt anymore, but originally did) import node def main(): n = Node("Test") print n.element main() but now i know why this doesnt work and the solution (see previous post of mine) thanks for all the help! -- http://mail.python.org/mailman/listinfo/python-list