Set Env : System User : System PYTHON examples


PYTHON examples » System » System User »

 

Set Env




import os
print 'setenv...',
print os.environ['USER']                 # show current shell variable value

os.environ['USER'] 'Brian'             # runs os.putenv behind the scenes
os.system('python echoenv.py')

os.environ['USER'] 'Arthur'            # changes passed to spawned programs
os.system('python echoenv.py')           # and linked-in C library modules

os.environ['USER'] = raw_input('?')    
print os.popen('python echoenv.py').read() 

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo System
» System User


Warning: Unknown: open(/var/lib/php/session/sess_flruhbqr0srksipdhf8vtbj476, O_RDWR) failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0