[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Automatically Writing a Dictionary

Tim Chase

1/25/2008 4:24:00 PM

>> d = dict(line.split(',').rstrip('\n')?
>
> Thanks. That worked except for the rstrip. So I did this:

Sorry...I got the order wrong on them (that's what I get for
editing after copy&pasting). They should be swapped:

d = dict(line.rstrip('\n').split(','))

to strip off the newline before you split it.

-tkc