Var substitution

Guy guy at lightwork.co.uk
Thu Jun 27 15:57:29 CEST 2002


Hi

What i'm wanting to know, is there any way of looking at a variables
value rather than its name.

Example

Unix : ${MyVar}
Dos  : %MyVar%

Both of the above will be subtituted with the values.

Example python script (below causes error):

>>> guy="name"
>>> import os
>>> os.guy

This is what should happen :

>>> import os
>>> os.name
'nt'



More information about the Python-list mailing list