How to Lock Globar Variables across Modules?

Joshua Muskovitz josh at open.com
Tue Sep 26 23:11:30 EDT 2000


How about creating a method in module2 which returns the value of the global
in module1 via an explicit reference?  You said that you were able to use
the variable in the second module but didn't like having to explicitly
reference it each time.

Thus in module2:

def getGlobvar():
    import module1
    return module1.globval_mod1





-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list