Re: Accessing global namespace from module

2007-06-12 Thread Gabriel Genellina
En Tue, 12 Jun 2007 18:37:45 -0300, Reuben D. Budiardja <[EMAIL PROTECTED]> escribió: >> import sys >> from types import ModuleType as module >> >> def setup(namespace): >> plotModule = module('plot') >> for key,value in namespace.items(): >> if key[:2] != '__': >>

Re: Accessing global namespace from module

2007-06-12 Thread Reuben D. Budiardja
On Monday 11 June 2007 23:49:14 Gabriel Genellina wrote: > En Mon, 11 Jun 2007 22:19:15 -0300, Reuben D. Budiardja > > It'll be great if I can > > put > > this trick on a single file that is included by the main scripts, to > > > According to your description on how things work, you will need the

Re: Accessing global namespace from module

2007-06-12 Thread Reuben D. Budiardja
On Monday 11 June 2007 23:49:14 Gabriel Genellina wrote: > En Mon, 11 Jun 2007 22:19:15 -0300, Reuben D. Budiardja > > >It'll be great if I can > > put > > this trick on a single file that is included by the main scripts, to > > avoid > > violating DRY principle. > > According to your description

RE: Accessing global namespace from module

2007-06-11 Thread John Krukoff
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Reuben D. > Budiardja > Sent: Monday, June 11, 2007 7:19 PM > To: python-list@python.org > Subject: Re: Accessing global namespace from module > > On Monday 11

Re: Accessing global namespace from module

2007-06-11 Thread Gabriel Genellina
En Mon, 11 Jun 2007 22:19:15 -0300, Reuben D. Budiardja <[EMAIL PROTECTED]> escribió: > One last question. Do I have to do this for ever script I write, or can > I put > this into separate file and "include" it somehow ? > I am going to have several mainscripts.py, and all is going to import

Re: Accessing global namespace from module

2007-06-11 Thread Reuben D. Budiardja
On Monday 11 June 2007 17:10:03 Gabriel Genellina wrote: > En Mon, 11 Jun 2007 17:29:35 -0300, reubendb <[EMAIL PROTECTED]> escribió: > > On Jun 11, 3:30 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > > > wrote: > >> En Mon, 11 Jun 2007 15:18:58 -0300, reubendb <[EMAIL PROTECTED]> > >> > >> escrib

Re: Accessing global namespace from module

2007-06-11 Thread Gabriel Genellina
En Mon, 11 Jun 2007 17:29:35 -0300, reubendb <[EMAIL PROTECTED]> escribió: > On Jun 11, 3:30 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Mon, 11 Jun 2007 15:18:58 -0300, reubendb <[EMAIL PROTECTED]> >> escribió: >> >> > The problem is I don't define the functions AddPlot() and Dra

Re: Accessing global namespace from module

2007-06-11 Thread reubendb
On Jun 11, 3:30 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 11 Jun 2007 15:18:58 -0300, reubendb <[EMAIL PROTECTED]> escribió: > > > The problem is I don't define the functions AddPlot() and DrawPlots(). > > It's built into the python interpreter of the CLI version of the > > progr

Re: Accessing global namespace from module

2007-06-11 Thread Gabriel Genellina
En Mon, 11 Jun 2007 15:18:58 -0300, reubendb <[EMAIL PROTECTED]> escribió: > The problem is I don't define the functions AddPlot() and DrawPlots(). > It's built into the python interpreter of the CLI version of the > program I mentioned, and they are defined on the main script. I load > the main s

Re: Accessing global namespace from module

2007-06-11 Thread reubendb
On Jun 11, 1:37 pm, [EMAIL PROTECTED] wrote: > On Jun 11, 11:02 am, reubendb <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > I am new to Python. I have the following question / problem. > > I have a visualization software with command-line interface (CLI), > > which essentially is a Python (v. 2.5)

RE: Accessing global namespace from module

2007-06-11 Thread John Krukoff
On Jun 11, 11:02 am, reubendb <[EMAIL PROTECTED]> wrote: > Hello, > I am new to Python. I have the following question / problem. > I have a visualization software with command-line interface (CLI), > which essentially is a Python (v. 2.5) interpreter with functions > added to the global namespace.

Re: Accessing global namespace from module

2007-06-11 Thread kyosohma
On Jun 11, 11:02 am, reubendb <[EMAIL PROTECTED]> wrote: > Hello, > I am new to Python. I have the following question / problem. > I have a visualization software with command-line interface (CLI), > which essentially is a Python (v. 2.5) interpreter with functions > added to the global namespace.