--snip-open new text file and write the contents of countydata to it print('writing results 'resultfile open('census py'' 'resultfile write('alldata pprint pformat(countydata)resultfile close(print('done 'the pprint pformat(function produces string that itself is formatted as valid python code by outputting it to text file named census pyyou've generated python program from your python programthis may seem complicatedbut the advantage is that you can now import census py just like any other python module in the interactive shellchange the current working directory to the folder with your newly created census py file and then import itimport os import census census alldata['ak']['anchorage'{'pop' 'tracts' anchoragepop census alldata['ak']['anchorage']['pop'print('the population of anchorage was str(anchoragepop)the population of anchorage was the readcensusexcel py program was throwaway codeonce you have its results saved to census pyyou won' need to run the program again whenever you need the county datayou can just run import census calculating this data by hand would have taken hoursthis program did it in few seconds using openpyxlyou will have no trouble extracting information that is saved to an excel spreadsheet and performing calculations on it you can download the complete program from com/automatestuff ideas for similar programs many businesses and offices use excel to store various types of dataand it' not uncommon for spreadsheets to become large and unwieldy any program that parses an excel spreadsheet has similar structureit loads the spreadsheet filepreps some variables or data structuresand then loops through each of the rows in the spreadsheet such program could do the following compare data across multiple rows in spreadsheet open multiple excel files and compare data between spreadsheets