hi dwblas;
I'm really am loosing my mind now. my code is only able to display the first entry, from there my if statement only evaluates to false for all other entries. please correct my code:
#Choice 2 - Display Balances
elif choice == "2":
lists = []
infile = open('emp_data. dat', 'r')
lists = cPickle.load(in file)
...
User Profile
Collapse
-
All your suggestions have been invaluable and I have gotten someway but when I cPickle the file I fail to read the contents back as a list
...Code:#Choice 2 - Display Balances elif choice == "2": lists = [] infile = open('emp_data.dat', 'r') #inlist = cPickle.load(infile) while 1: try: lists.append(cPickle.load(infile))Leave a comment:
-
How to read specific item in a list
I have created a list and would like to read specific items in it, I only can read 1
...Code:import cPickle, sys, shelve ## open file that stores scores choice = None employees = [] while choice != "0": print \ """ 411 TUCKSHOP OPTIONS: 0 - Exit 1 - Employee:Last edited by Niheel; Aug 18 '11, 07:48 AM.
No activity results to display
Show More
Leave a comment: