Write 10k integers to a file using struct

Thomas 2002 at weholt.org
Tue Oct 26 22:06:35 CEST 2004


What's the quickest way to write and read 10.000 integer values ( or
more )  to and from a file? Using struct somehow? The example in the
docs shows how to handle to or three arguments, but is the fastest way
to write and read just a simple :

while data:
	f.write(struct.pack(format, integer-value))

or is there another, quicker and nicer way to do it????

Thomas



More information about the Python-list mailing list