raghu raghu wrote:
>
> [snip original message]
>
>
> To print or to retain individual values from a list,it has to be
> written in the form of
> config={'test1':'elem1','test2':'elem2','test3':'elem3'}
> config['test4'] = 'elem4'
> print config.values()
> print config['test1']- To get individual v
I like this solution.
Thanks everyone for all of the suggestions.
On 1/11/07, Andre Engels <[EMAIL PROTECTED]> wrote:
> 2007/1/11, raghu raghu <[EMAIL PROTECTED]>:
>
> > >>> print "\\".join((config["val2"]
> > ,config["val1"],config["val3"]))
> > elem2\elem1\elem3
> >
> > or
> >
> > >>> print "%s
2007/1/11, raghu raghu <[EMAIL PROTECTED]>:
>>> print "\\".join((config["val2"],config["val1"],config["val3"]))
elem2\elem1\elem3
or
>>> print "%s\\%s\\%s" % (config["val2"],config["val1"],config["val3"])
elem2\elem1\elem3
but this seems somehow uneligent.
Are there a more efficient/compact
Hi everyone,
I have a quick quick question joining out of order dictionary values.
For example:
I created an empty
config={}
Added some key/value pairs
config["test1"]="elem1"
config["test2"]="elem2"
config["test3"]="elem3"
etc
Dumped the values and joined them at the same time.
On 11/01/07, Andrew Robert <[EMAIL PROTECTED]> wrote:
> Only some of the key/value pairs in the dictionary are needed so a
> dump of all values does not work.
>
> Also, the order in which the values are joined is important so walking
> through and joining all values does not work either.
Well, a d
Hi everyone,
I have a quick quick question joining out of order dictionary values.
For example:
I created an empty
>>> config={}
Added some key/value pairs
>>> config["test1"]="elem1"
>>> config["test2"]="elem2"
>>> config["test3"]="elem3"
etc
>>>
Dumped the values and joined them at