I am currently learning python programming (and am a beginner at it). Currently I am stuck on files exercises (so these are set things I need to do, rather than doing whatever I want. Unfortunately, it also means I probably can't do any complicated (for me) shortcuts)

Currently using Python 3.2.2

I need two different programs. One is to input what the user types in (a name and a DOB) and put that into records in a list and write that into a binary file. The other is to read that file and print that into a table using padding.

2 Answers
2

When pickle loads the file it tries to creates newperson instances, but newpersonis not defined in the second program. To solve that problem, you could create a new file newperson.py just containing the definition of the class `newperson.py``

Thanks :) That fixed it. I'll keep the use of the additional file and referencing that and dictionaries in mind, however I haven't really got onto them yet (really early beginner) so for now, I'll just repeat the class. Thanks again :)
–
PCJonathanFeb 3 '12 at 11:26