Podobne to ide aj v Perle:
$nazev_promenne='var01';
$$nazev_promenne=1;
print 
"\$nazev_promenne=$nazev_promenne,\n\$$nazev_promenne=$$nazev_promenne\n"

Myslim si, ze v Pythone sa toto neda urobit.
Ja by som v Pythone pouzil na ukladanie nazvov premennych a ich hodnot 
slovnik, asi takto
>>> nazev_promenne={}
>>> nazev_promenne['var01']=1
>>> print nazev_promenne

 



"Lansky, Milan - Acision" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
06.03.2008 10:40
Please respond to
Konference PyCZ <python@py.cz>


To
python@py.cz
cc

Subject
[python] problem s odkazem na promennou






Lze se v Pythonu odkazat na promenou jejiz nazev neni dopredu znam? 
Rekneme, jak nastavit promennou var01, kdyz mam k dispozici pouze
retezec ‘var01’?
 
V bashi se to resi funkci eval:
# nazev_promenne=var01
# eval $nazev_promenne=1
# echo $var01
1
 
Dekuji za odpoved.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an 
intended recipient then please promptly delete this e-mail and any 
attachment and all copies and inform the sender. Thank you. 
_______________________________________________
Python mailing list
Python@py.cz
http://www.py.cz/mailman/listinfo/python

Mgr. Ing. Roman MIKLÓŠ 
Prvá stavebná sporiteľňa a.s. 
Bajkalská 30, P. O. Box 48 
829 48  Bratislava 25 
Tel.: +421/ 2 / 582 31 174 
Fax: +421/ 2 / 582 31 109 

Mgr. Ing. Roman MIKLÓŠ 
Prvá stavebná sporiteľňa a.s. 
Bajkalská 30, P. O. Box 48 
829 48  Bratislava 25 
Tel.: +421/ 2 / 582 31 174 
Fax: +421/ 2 / 582 31 109 

_______________________________________________
Python mailing list
Python@py.cz
http://www.py.cz/mailman/listinfo/python

Odpovedet emailem