[Tutor] Pouring a list into a dictionary

Allen Schmidt aschmidt at fredericksburg.com
Thu Sep 4 20:54:00 EDT 2003


Maybe the wrong title, but here is my issue:

I have a file that I parse out to lists.
The first line contains the column headers.
The rest of the lines contain the rows of data elements.

I need to loop through the each row, grab each column name from the first
line
and would like to use each one as the key in a dictionary.

Then for each subsequent row, grab each data element and use the
dictionary key for the correct placement as that key's value.

Make sense?? Kinda hard to explain.

Any gentle nudges in the right direction would be greatly appreciated.

Allen




More information about the Tutor mailing list