[Baypiggies] python newbie

Jerome Jabson jjabson at yahoo.com
Mon Mar 6 17:01:03 CET 2006

I'm having problems trying to parse a text file and
separating it's contents into a dictionary. The file
as something like:

This is the description of the name.

Another description of this name.

The dictionary should look like:

dict = {name: This is the description of the name.,
another_name: Another discription of this name}

I tried doing something like:

dict = {}
f = open("text-file", "r)
for line in f:
   items = line
    dict[items[0]] = items[1:]
print dict

but the dictionary comes out all wrong! :-( Can
someone give me some pointers on how to do this.

Help is much appreciated!

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Baypiggies mailing list