import data structure

monkeys paw user at example.net
Fri Jan 15 18:32:35 EST 2010


I want to store data in a file like show below. Then
i want to import the data in, but am having trouble.
I'm trying:

import sfdata

for x in author_list:
     print x



FILE: sfdata.py (i'm trying to import it)
==============

author_list = {
                  '829337' : {
                                'author_name' : 'Carter, John',
                                'count' : 49,
                                'c2' : '0.102040816326531',
                                'author_party' : 'R',
                                'f1' : '0.102040816326531',
                                'f2' : '0.102040816326531',
                                'author_entry_name' : 'Carter',
                                'c1' : '0.122448979591837'
                              },
                  '825522' : {
                                'author_name' : 'Stark, Fortney',
                                'count' : 171,
                                'c2' : '0.0116959064327485',
                                'author_party' : 'D',
                                'f1' : '0.0233918128654971',
                                'f2' : '0.0116959064327485',
                                'author_entry_name' : 'Stark',
                                'c1' : '0.0233918128654971'
                              },
}



More information about the Python-list mailing list