Help with 'popen'
jstroud at mbi.ucla.edu
Mon Jan 22 06:59:08 CET 2007
> Can someone let me know why this won't work? Thanks.
>>>>from os import popen
Python starts a new shell for each command, so your environment variable
is lost. You probably want this, which makes the variable "permanent".
py> import os
py> os.environ['asdfasdf'] = 'hello'
py> os.popen('echo $asdfasdf').read()
More information about the Python-list