How to add a folder to the Windows PATH temporarily with Python? -


how can add multiple folders windows path in python on windows?

i have multiple programs (wget windows, phantomjs, casperjs, ...) want use python script. , think idea add these folders path , remove them when script ended don't know if it's possible...

%path% environment variable, visible in python doing this:

import os print(os.environ['path']) 

this string, can make arbitrary modifications to. so, might this:

 os.environ['path'] += ';c:\\wget' 

any modifications make visible in script, , other processes launch - don't need remove modifications after you're done stop them persisting in wider os.


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -