From: Peter Otten <__pete...@web.de> wrote: snip <<How did you write the data into the pickle file? The normal approach is to write all your data in one step, e. g. (all code snippets untested)>>
Thanks Peter, that was it. I was treating pickle like standard file i/o when it's not that at all. The reason why I'm "pickling" is I'm trying to include information on Python data structures in the presentaton I'm preparing. Here are the two programs that now work correctly together: import pickle pickle_file = open("d:/Work/pickle_file", "wb") Qb_dict = {"Montana": ["Joe", "Montana", "415-123-4567", "joe.mont...@gmail.com","Candlestick Park"], "Tarkington": ["Fran", "651-321-7657", "frank.tarking...@gmail.com", "Metropolitan Stadidum"], "Namath": ["Joe", "212-222-7777", "joe.nam...@gmail.com", "Shea Stadium"], "Elway": ["John", "303-9876-333", "john.el...@gmai.com", "Mile High Stadium"], "Elway": ["Ed", "303-9876-333", "john.el...@gmai.com", "Mile High Stadium"], "Manning": ["Archie","504-888-1234", "archie.mann...@gmail.com", "Louisiana Superdome"], "Staubach": ["Roger","214-765-8989", "roger.staub...@gmail.com", "Cowboy Stadium"]} pickle.dump(Qb_dict, pickle_file) pickle_file.close() # # pickle_in.py # program to read in a pickled file # # Frank L. Palmeri # import pickle # import the pickle module pickle_file = open("d:/Work/pickle_file", "rb") # open the pickled file read_list = pickle.load(pickle_file) # read the first pickled row print(read_list) # print the input row from the pickled file pickle_file.close() # close the pickled file -- Frank L. "Cranky Frankie" Palmeri _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor