Re: [Tutor] binary file query

2011-11-18 Thread Prasad, Ramit
>No *need* but, often convenient, regardless of whether the data was >written by a C struct or not.(*) It is a way to interpret binary data in >terms of fundamental data types such as ints, floats, strings etc. >Trying to convert raw bytes representing floats into a floating point >number witho

Re: [Tutor] binary file query

2011-11-17 Thread Alan Gauld
On 17/11/11 14:55, Prasad, Ramit wrote: It means that no need to use the 'Struct' module for binary file read, right? Its not necessary but if the data does not already have a file handling module then the struct module is a very convenient way of accessing the data. It really depends on

Re: [Tutor] binary file query

2011-11-17 Thread Prasad, Ramit
-Original Message- From: Shirkhedkar, Dhanashri [mailto:dhanashri.shirkhed...@honeywell.com] Sent: Wednesday, November 16, 2011 10:58 PM To: Prasad, Ramit Subject: RE: binary file query Thanks for replying. It means that no need to use the 'Struct' module for binary file read, right? ===

Re: [Tutor] binary file query

2011-11-16 Thread Prasad, Ramit
>If we are opening a binary file in python then do we have to use "Import >struct" and do "struct.unpack" to work on the data from that binary file? >Will we be able to process the file as text file without using struct? You should open the file with the 'rb' parameter and then read from it as yo

Re: [Tutor] binary file query

2011-11-16 Thread Alan Gauld
On 14/11/11 05:34, Shirkhedkar, Dhanashri wrote: If we are opening a binary file in python then do we have to use “Import struct” and do “struct.unpack” to work on the data from that binary file? That depends but in general the answer is no. But it all depends on what is in the file. If it is a

[Tutor] binary file query

2011-11-16 Thread Shirkhedkar, Dhanashri
If we are opening a binary file in python then do we have to use "Import struct" and do "struct.unpack" to work on the data from that binary file? Will we be able to process the file as text file without using struct? Thanks, Dhanashri ___ Tutor