On 17/11/13 12:19, Satheesan Varier wrote:
class myclass():
         def test(self):
             print "print this line"

if __name__ == '__main__':
           myclass.run()

You can do the test run with an instance of that class, as follows:

 >>> k=myclass()

 >>> myclass.test(k)
print this line

Or more conventionally

k.test()

Please don't post the entire digest when replying, remove any irrelevant material. Some people pay by the byte and don't
want to pay for stuff they've already seen.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to