Beginners question

Ronn Ross ronn.ross at gmail.com
Sat Jul 18 03:42:43 CEST 2009


How do you define a global variable in a class. I tried this with do
success:
class ClassName:
    global_var = 1

    def some_methos():
        print global_var

This doesn't work. What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090717/0527713c/attachment.html>


More information about the Python-list mailing list