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

how can I interpret a file within the interactive interpreter

2007-11-13 Thread Peter J. Bismuti
I want to interpret a file (or whatever you call it) and then keep the interactive interpreter alive so I can then continue to issue commands. How can this be done? I saw online a -m flag but it does not seem to work. Thanks -- Peter Bismuti Boeing --

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,

module data member?

2007-11-13 Thread Peter J. Bismuti
How do you define a module data member (I want to understand out how this works before making converting to a Class)? Right now I'm defining variables in a module that get put into the global namespace. Instead I want to put them in a module global namespace that will be the same regardless

Re: how can I interpret a file within the interactive interpreter

2007-11-13 Thread Peter J. Bismuti
, 16:40:09) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type help, copyright, credits or license for more information. Peter J. Bismuti wrote: I want to interpret a file (or whatever you call

Re: module data member?

2007-11-13 Thread Peter J. Bismuti
This did the trick for the most part, but it still leaves a copy of the variable A in the non-module global namespace (see output below). I want A declared global to the module (so as not to be local within the functions of the module) but not visible outside of the module namespace (like B,

Re: [OT] The Jew Spam on this list: Blocking the IP address of spammers

2007-11-13 Thread Peter J. Bismuti
Why aren't these spammers having their IP addresses blocked (or something like that)? People making these posts should not be allowed to post ever again. Is there not someone administering this mailing list? I agree! On Nov 13, 2007 1:26 PM, Martin Marcher [EMAIL PROTECTED] wrote:

persisting data within a module

2007-11-12 Thread Peter J. Bismuti
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. For example, consider the two simple modules below. The first method

Re: Distributed RVS, Darcs, tech love

2007-11-12 Thread Peter J. Bismuti
Be nice. Boy, you really have to get a clue. -- http://mail.python.org/mailman/listinfo/python-list

accessing attributes when inheriting?

2006-03-16 Thread Peter J. Bismuti
How do you access attributes of a class when inheriting from it? Can't you just say: self.attribute? Help?! ... #!/usr/bin/python from Dialog import Dialog import enscmd class