<br><br><div class="gmail_quote">On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross <span dir="ltr"><<a href="mailto:ronn.ross@gmail.com">ronn.ross@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins <span dir="ltr"><<a href="mailto:marduk@letterboxes.org" target="_blank">marduk@letterboxes.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote:<br>
> I need to read a binary file. When I open it up in a text editor it is<br>
> just junk. Does Python have a class to help with this?<br>
<br>
</div>Yes, the "file" class.<br>
<br>
>>> myfile = open('/path/to/binary/file', 'rb')<br>
<br>
-a<br>
<font color="#888888"></font></blockquote></div><div>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:<br>

2009.08.02_06.52.00_WA-1_0001_00_0662_0.jstars<br><br>Should python have trouble reading this file name or extension?  <br></div></div>
</blockquote></div>I'm having trouble with the filename: <br>2009.08.02_06.52.00_WA-1_0001_00_0662_0.jstars<br><br>It throws an error with that file name, When I change it to something like sample.txt it runs, but the data is still garbled. Is there any reason why I can't use the above file name? If I'm using 'rb' to read the binary file why is it still garbled?<br>
<br><br>