Setting Environment Variables

From: Greg Lindstrom (greg.lindstrom_at_novasyshealth.com)
Date: 10/20/04


To: <python-list@python.org>
Date: Wed, 20 Oct 2004 15:07:17 -0500

Hello-

I am running python 2.3. on an HP-9000 box running Unix and have a POSIX
script that sets up my production environment. I would like to run the
script from inside a python routine and pick up the environment variables
but am having trouble getting it done. Suppose the script is called
setprod. How can I call this from inside a python script then pick up the
env's later in my program? I've tried os.system ('setprod') and
os.system('. setprod'), but neither seemed to work.

Thanks for your help,
--greg

Greg Lindstrom (501) 975-4859
NovaSys Health greg.lindstrom@novasyshealth.com

"We are the music makers, and we are the dreamers of dreams" W.W.



Relevant Pages

  • Re: perl to python
    ... sed and perl can let you do all that quick command line stuff. ... into a full blown script. ... scripts, call it from the python interpreter, whatever I need. ... If I stick to the traditional unix approach, ...
    (comp.lang.python)
  • Re: Learning Tkinter
    ... and how the command option is used to call the function callback. ... gui programming to see if the python programs I have written can be made ... search their computer for this file, execute the python code and then ... This is the meaning of the test on __name__: this magical variable is set to the string '__main__' if and only if the current script is the top-most one, i.e the one you ran python on. ...
    (comp.lang.python)
  • Correct way to handle independent interpreters when embedding in a single-threaded C++ app
    ... The Python interpreter is ... interpreter and provides an extension module to expose ... manage each script runs in a new interpreter. ... globals that could cause issues. ...
    (comp.lang.python)
  • Re: bash vs. python scripts - which one is better?
    ... Quick, take your one liner, have it traverse an entire directory tree ... For me I just need to change my small script into a function, ... That is where shell falls down. ... alternatives like Python, Perl or Ruby laying around to be used. ...
    (Debian-User)
  • Re: File IO question.
    ... > Well if you're using the logging class from Python ... The ideal solution would be a script that could be run ... would remove data from the trace file periodically. ... New and Improved Yahoo! ...
    (comp.lang.python)