[Tutor] Import modeuls

arsyed arsyed at gmail.com
Mon Jul 21 11:36:42 CEST 2008


On Mon, Jul 21, 2008 at 5:15 AM, Oleg Oltar <oltarasenko at gmail.com> wrote:

> They want me to do one test runner which runs any test... And ideally it
> should work on any platform....
>
> When I added something to $PYTHONPATH, they told me to remove it...
>
>
You can set environment variables within python, e.g.:

os.environ['PYTHONPATH'] = '/some/path:' + old_path

What I don't know is if child processes invoked through os.popen inherit
that variable on all platforms. However, the subprocess.Popen object takes
an explicit "env" variable for that purpose:

http://docs.python.org/lib/node528.html
http://docs.python.org/lib/module-subprocess.html

So you should be able to use that for the same effect.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080721/7c6a6048/attachment.htm>


More information about the Tutor mailing list