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 f
Be nice.
> Boy, you really have to get a clue.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
--
http://mail.python.org/mailman/li
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
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 regardles
an 9 2007, 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.
>>>
>>>
&
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
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:
> >
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 RatDialog(Dial
10 matches
Mail list logo