paths (Newbee question)

Thomas Guettler pan-newsreader at thomas-guettler.de
Thu Jan 23 22:40:24 CET 2003


On Thu, 23 Jan 2003 16:29:11 +0100, Joseph C. Slater wrote:

> I'm trying to use os.popen to run ps2pdf on a file. This works fine, as
> long as p2pdf is in the path, along with all of the other things it
> needs. To make a long story short, how do I, inside python, not in the
> call, set these paths?

Depending on your operating system you can do:

os.popen("PATH=%PATH%;C:\\foo\\bar & ps2pdf ...")

or

os.popen("PATH=$PATH:/home/foo; export PATH; ps2pdf ...")

Maybe there is a portable way, too.

 thomas

-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de




More information about the Python-list mailing list