Dnia wtorek, 5 września 2006 08:32, [EMAIL PROTECTED] napisał: > i have a complex data in binary file and i want to read its > fields... the C way is to read file in buffer and then cast > it to proper structure. Is there a way to do the same in > Python or i have to read the data byte by byte ?
cite: ----------------- struct -- Interpret strings as packed binary data This module performs conversions between Python values and C structs represented as Python strings. It uses format strings (explained below) as compact descriptions of the lay-out of the C structs and the intended conversion to/from Python values. This can be used in handling binary data stored in files or from network connections, among other sources. ----------------- see http://docs.python.org/lib/module-struct.html -- Pawel Kraszewski http://www.kraszewscy.net _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
