Re: Reading binary files

2009-08-30 Thread Dan Stromberg
David Robinow wrote: This works for a simple binary file, but the actual file I'm trying to read is give throwing an error that the file cannot be found. Here is the name of the my file: 2009.08.02_06.52.00_WA-1_0001_00_0662_0.jstars Should python have trouble reading this file name or

Reading binary files

2009-08-24 Thread Ronn Ross
I need to read a binary file. When I open it up in a text editor it is just junk. Does Python have a class to help with this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary files

2009-08-24 Thread Rami Chowdhury
The built-in file type deals with this just fine. You can simply specify when opening the file that it is to be opened as binary: http://docs.python.org/library/functions.html#open On Mon, 24 Aug 2009 07:35:09 -0700, Ronn Ross ronn.r...@gmail.com wrote: I need to read a binary file. When I

Re: Reading binary files

2009-08-24 Thread Albert Hopkins
On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote: I need to read a binary file. When I open it up in a text editor it is just junk. Does Python have a class to help with this? Yes, the file class. myfile = open('/path/to/binary/file', 'rb') -a --

Re: Reading binary files

2009-08-24 Thread Ronn Ross
On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross ronn.r...@gmail.com wrote: On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins mar...@letterboxes.orgwrote: On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote: I need to read a binary file. When I open it up in a text editor it is just junk.

Re: Reading binary files

2009-08-24 Thread Dave Angel
Ronn Ross wrote: On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross ronn.r...@gmail.com wrote: On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins mar...@letterboxes.orgwrote: On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote: I need to read a binary file. When I open it up in a text

Re: Reading binary files

2009-08-24 Thread David Robinow
This works for a simple binary file, but the actual file I'm trying to read is give throwing an error that the file cannot be found. Here is the name of the my file: 2009.08.02_06.52.00_WA-1_0001_00_0662_0.jstars Should python have trouble reading this file name or extension? I'm having

Reading binary files

2005-11-23 Thread amfr
On windows, is there anything special I have to do to read a binary file correctly? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary files

2005-11-23 Thread Grant Edwards
On 2005-11-23, amfr [EMAIL PROTECTED] wrote: On windows, is there anything special I have to do to read a binary file correctly? Open it in binary mode? -- Grant Edwards grante Yow! I didn't order at any

Re: Reading binary files

2005-11-23 Thread Fredrik Lundh
amfr [EMAIL PROTECTED] wrote On windows, is there anything special I have to do to read a binary file correctly? the documentation has the answer: http://docs.python.org/lib/built-in-funcs.html#l2h-25 Append 'b' to the mode to open the file in binary mode, on systems that