Add System Path?!?

Fouff fouff at fouff.com
Wed Apr 6 02:16:13 EDT 2005


andrea_gavana at tin.it a écrit :
> Hello NG,
> 
>     I have a GUI (written in wxPython) that calls some external exe files.
> Some of them requires that I add to the PATH variable 1 directory. Basically,
> the exe are located in:
> 
> /MyApp/Solvers/FirstExe
> /MyApp/Solvers/SecondExe
> 
> And so on, while the dll needed by these exe are located in:
> 
> /MyApp/MyDll
> 
> These exe files do not work if I don't set the PATH variable also to that
> adress. I know I can do it by hand (and also my users can), but I wonder
> if there is a way to do it in Python...
> 
> Thank you for all suggestions/pointers.
> 
> Andrea.
> 
> 
Why not just adding in your app

import os
os.environ['PATH'] += ";the_new_adress_needed_by_exe"

this will just modify locally to your app the environement variable PATH

If you want to modify it for ever, just open a console DOS (cmd.exe) and 
type:
set PATH=%PATH%;the_new_adress_needed_by_exe




More information about the Python-list mailing list