Adonis Vargas <[EMAIL PROTECTED]> writes: > Pyenos wrote: > > class TREE: > > def gettree(self):print self > > TREE.gettree() # I get an error saying # TypeError: > > unbound method gettree() must be called > > # with TREE instance as first argument (got nothing instead > > I still don't understand how to solve this simple code. > > You first need to create an instance of the class: > > tree = TREE() > tree.gettree() > > or > > TREE().gettree() > > Hope this helps. > > Adonis > > P.S. You should look into the tutorial > http://docs.python.org/tut/tut.html it will answer a lot of your > questions.
Yes, it definitely solved my problem. Thank you very much. :D -- http://mail.python.org/mailman/listinfo/python-list