Re: A variables variables

2008-08-26 Thread Bruno Desthuilliers
castironpi a écrit : On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote: how can I declare a variable with another variable name? for example I will use PHP: $a= "hello"; $a_hello="baybay"; print ${'a_'.$a) //output: baybay how can i do it with no Arrays using python thanks! Here'

Re: A variables variables

2008-08-24 Thread Maric Michaud
Le Sunday 24 August 2008 03:24:29 Terry Reedy, vous avez écrit : > Gandalf wrote: > > how can I declare a variable with another variable  name? > > > > for example  I will use PHP: > > > > $a= "hello"; > > > > $a_hello="baybay"; > > > > print ${'a_'.$a)  //output: baybay > > > > > > how can i do it

Re: A variables variables

2008-08-23 Thread Gandalf
OK thank you all ! sometimes you just getting use to somethings... -- http://mail.python.org/mailman/listinfo/python-list

Re: A variables variables

2008-08-23 Thread Terry Reedy
Gandalf wrote: how can I declare a variable with another variable name? for example I will use PHP: $a= "hello"; $a_hello="baybay"; print ${'a_'.$a) //output: baybay how can i do it with no Arrays using python Others have given you the direct answer. But using lists or dicts is al

Re: A variables variables

2008-08-23 Thread Benjamin
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote: > how can I declare a variable with another variable  name? > > for example  I will use PHP: > > $a= "hello"; > > $a_hello="baybay"; > > print ${'a_'.$a)  //output: baybay Doing this sort of thing in Python is very anti idiom. > > how can i do

Re: A variables variables

2008-08-23 Thread Mohamed Yousef
i don't know if this volatiles array condition or not but any way q='asd' asdasd=20 print globals()[q+'asd'] -- http://mail.python.org/mailman/listinfo/python-list

Re: A variables variables

2008-08-23 Thread castironpi
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote: > how can I declare a variable with another variable  name? > > for example  I will use PHP: > > $a= "hello"; > > $a_hello="baybay"; > > print ${'a_'.$a)  //output: baybay > > how can i do it with no Arrays using  python > > thanks! Here's one

A variables variables

2008-08-23 Thread Gandalf
how can I declare a variable with another variable name? for example I will use PHP: $a= "hello"; $a_hello="baybay"; print ${'a_'.$a) //output: baybay how can i do it with no Arrays using python thanks! -- http://mail.python.org/mailman/listinfo/python-list