List,

How do I get a print statement to call a class method? I'm using
python 2.5. I did it long ago, but can't remember how, or even where I
learned it from. Something like:

class Foo():
   def __init__(self):
      pass

   def  ***part I can't remember goes here***
      print "hello world!"

 # Now use it:
bar = Foo()
print bar
hello world! #<-- Magic!


If any of this makes sense, any pointers would be great!
-Modulok-
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to