"Válas Péter" <[email protected]> wrote
Modified code:
f=open("xxx.dat","wb") The others remain as above, just I wrote wb.

Yes, you need to use binary mode.

I read something about a pack function, is that the key?

See the file handling topic in my tutorial for a simple
example of using the struct module(which includes the
pack function) to write/read binary data.

But, pickle or shelve are probably more useful
for your needs if you want to save entire Python
objects.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to