Re: to create variable from dict

2010-03-15 Thread hiral
On Mar 12, 8:02 pm, Jean-Michel Pichavant wrote: > Luis M. González wrote: > > On Mar 12, 10:59 am,hiral wrote: > > >> Hi, > > >> Is there any way to create variables which name matches with dict key? > > >> For example: > >> dict1 = {"abc":'1", "def":"2"} > > >> Now I am looking to have variable

Re: to create variable from dict

2010-03-13 Thread Andreas Waldenburger
On Fri, 12 Mar 2010 06:50:18 -0800 (PST) Luis M. González wrote: > The question is: should you do it? And the answer is: No. And the usual disclaimer is: (Unless you *know* it's the best possible solution to your problem.) /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/pytho

Re: to create variable from dict

2010-03-12 Thread Jean-Michel Pichavant
Luis M. González wrote: On Mar 12, 10:59 am, hiral wrote: Hi, Is there any way to create variables which name matches with dict key? For example: dict1 = {"abc":'1", "def":"2"} Now I am looking to have variable name abc and it's value be '1' etc. Pl. suggest. Thank you. Check out

Re: to create variable from dict

2010-03-12 Thread Luis M . González
On Mar 12, 10:59 am, hiral wrote: > Hi, > > Is there any way to create variables which name matches with dict key? > > For example: > dict1 = {"abc":'1", "def":"2"} > > Now I am looking to have variable name abc and it's value be '1' etc. > > Pl. suggest. > > Thank you. Check out this thread (ver

Re: to create variable from dict

2010-03-12 Thread Tim Chase
hiral wrote: Is there any way to create variables which name matches with dict key? For example: dict1 = {"abc":'1", "def":"2"} Now I am looking to have variable name abc and it's value be '1' etc. 1) you can't because "def" is a reserved word in Python. 2) why do you want to? This seems to