Re: persisting data within a module

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 13:09:01 -0300, Peter J. Bismuti <[EMAIL PROTECTED]> escribió: > How is that state different depending on whether a module has been simply > imported (#2. some other block of code has __name__ == "__main__") and > the > script itself being run (#1. and having __name__=="__

Re: persisting data within a module

2007-11-13 Thread Peter J. Bismuti
How is that state different depending on whether a module has been simply imported (#2. some other block of code has __name__ == "__main__") and the script itself being run (#1. and having __name__=="__main__")? Ultimately, what I want is for a module to remember (persist) the value of A, rega

Re: persisting data within a module

2007-11-13 Thread Peter J. Bismuti
I'm not sure how to better state my question than to post my code. The question boils down to which namespace to variable in the module (in this case A) end up in depending on whether or not the module is simply imported by another module which acts as the driver (run.py is __main__), or when

Re: persisting data within a module

2007-11-12 Thread [EMAIL PROTECTED]
On Nov 12, 5:30 pm, "Peter J. Bismuti" <[EMAIL PROTECTED]> wrote: > I'm having trouble understanding how namespaces work in modules. I want to > execute a module within the interpreter and then have values that are > calculated persist so that other modules that get executed can retrieve them. >