Embedding setenv

Fredrik Lundh fredrik at pythonware.com
Thu Feb 22 10:10:53 EST 2001


Clodagh O'Rourke wrote:
> os.environ['VARIABLE'] = 'value'
>
> And I got.....
>
> SyntaxError: can't assign to function call

Are you sure you used square brackets?

>>> os.environ('VARIABLE') = 'value'
SyntaxError: can't assign to function call

>>> os.environ['VARIABLE'] = 'value'
>>> os.environ['VARIABLE']
'value'

Cheers /F





More information about the Python-list mailing list