[Tutor] Class attribute error

Dominik George nik at naturalnet.de
Sun Nov 17 00:55:11 CET 2013


On Sat, Nov 16, 2013 at 09:13:13AM -0800, reutest wrote:
> class myclass():
> 	    
> 	      def test(self):
> 	            print "print this line"
> 	            
> 
> if __name__ == '__main__':
>           myclass.run()

Is that a question?

If I were to guess, I'd say you should have asked "Why does this say
that myclass does not havea run method?". Then the simple answer is:
Because, well, it doesn't! Why do you expect it to have one?

-nik

-- 
Wer den Grünkohl nicht ehrt, ist der Mettwurst nicht wert!

PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 905 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/tutor/attachments/20131117/5d249c0d/attachment.sig>


More information about the Tutor mailing list