[Tutor] convert to dict

Larry Blair lbblair at adaptisinc.com
Tue Apr 27 11:32:52 EDT 2004


I have been doing Python for only about 2 weeks so sorry for the beginners
question. I have looked in the archives, etc. and suspect I don't know
enough python vocabulary to ask the correct questions. I am converting some
Jython programs I inherited and I think there are built-ins to do this
easier in Python.

I have a string (below) that I want to convert to a dictionary. I think I
can do it with a for loop and using split but just don't quite have the
skills to manipulate the data. I am getting the data from a text properties
file I read into the program.

Thanks for any help
Larry


lb = ['TEMP01.DBF : 1024', 'TEMP02.DBF : 1024', 'TEMP03.DBF : 1024',
'TEMP04.DBF : 1024', 'TEMP05.DBF : 1024', 'TEMP06.DBF : 1024']







__________________________________ 
Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain information
that is confidential privileged and/or exempt from disclosure under
applicable law.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.
Thank you.



More information about the Tutor mailing list