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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -