Saving parameters between Python applications?

Stodge stodge at gmail.com
Mon Sep 17 12:01:58 EDT 2007


You're probably right!

Thanks all. :)

On Sep 17, 10:15 am, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> Stodge a écrit :
>
>
>
> > I'm trying to do the following. I have a Python application that is
> > run:
>
> > python app1.py --location=c:\test1
>
> > What I want to do is save the location parameter, so I can then do (in
> > the same window):
>
> > python app2.py
>
> > And have app2.py automatically have access to the value of "location".
>
> > Now, the difficult part is, that in another window I want to do:
>
> > python app1.py --location=c:\test2
> > python app2.py
>
> > And have app2.py automatically get c:\test2 as the location. So the
> > two windows (consoles) are isolated from each other.
>
> > I thought I could use os.environ, but that doesn't save the variable
> > for applications that are run afterwards in the same window.
>
> > Any suggestions?
>
> Yes : pass the same arg to both app1.py and app2.py !-)
>
> Braindead, I know, but still the simplest solution.





More information about the Python-list mailing list