the Love of things- Py

Page 367

manage your data

def get_from_store(): all_athletes = {} try: with open('athletes.pickle', 'rb') as athf: all_athletes = pickle.load(athf) except IOError as ioerr: print('File error (get_from_store): ' + str(ioerr)) return(all_athletes) def get_names_from_store(): athletes = get_from_store() response = [athletes[each_ath].name for each_ath in athletes] return(response)

This might seem a little drastic...but sometimes a redesign requires you to throw away obsolete code.

you are here 4   331


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.