global vars across modules

mamboknave at gmail.com mamboknave at gmail.com
Sun Apr 22 16:08:05 EDT 2012


On Sunday, April 22, 2012 12:48:23 PM UTC-7, Roy Smith wrote:
....
> Answer 1: You can't.
> 
> Answer 2: You might want to look at thread local storage 
> (http://docs.python.org/library/threading.html#threading.local).
> 
> Answer 3: Are you sure you really want to do this?

Thanks! Here is what I need to do, perhaps you can give me some hints.

A generic module, used across different independent programs, puts its computing results in a var fairly big, ~50KB.

I need the functions in these programs to access that var. No assignment will be made to that var, it will just be accessed to parse its content.

How can I do? I cannot think of making that var local and 'returning' ~50KB all the times the module is called.

Any hint...?



More information about the Python-list mailing list