Simple account program
Greg Ewing
greg at cosc.canterbury.ac.nz
Mon Mar 21 22:28:45 EST 2005
Igorati wrote:
> pickle.dump ((withdrawl), file ('account.pickle', 'w'))
^^^^^^^^^
Is this banking done with an American accent? :-)
> pickle.dump ((deposit), file ('account.pickle', 'w'))
> Am I on the right track?
The file you create in the second statement is going
to overwrite the first one. If you want to append
data to an existing file, you need to open it in
'a' mode.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list