ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: where are the "class variables"?
by Tom Hanks other posts by this author
Oct 1 2003 1:16AM messages near this date
Re: where are the "class variables"? | Re: where are the "class variables"?
Access class members... as members of the class! :)

class Server(threading.Thread):
    running = 0

    def run(self):
        Server.running = 1                # note added "Server."
        while Server.running:             # ditto, added "Server."
            print "do something here..."  

    def exit(self):
        Server.running = 0                # ditto, added "Server."

TTFN,
Tom.
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Dominik Kaspar
Gerrit Holl
Gerrit Holl
Tom Hanks
John Roth
Bob Gailer

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved