Without sight of code it's only a guess but are you creating
the file with the 'wb' mode - ie. write binary? :-

myPickleFile = open("somefilename.dat", "wb")



oops. Not as in object orientated programming, just as in oops, i messed 
up. pasted wrong bit of code. Here is the relative bit.
def General_info():
file4 = open("Genfacts.p", "rb")
Ginfo = pickle.load(file4)
file4.close()
print('General Information: ')
GinfoKey = input('CatKey: ')
GinfoFact = input('Info: ')
Ginfo[GinfoKey] = GinfoFact  # add new key:fact
file4 = open("Genfacts.p", "wb")
pickle.dump(Ginfo, file4)
file4.close()
return(Ginfo)
Ken
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to