Re: Using struct to read binary files

2009-11-27 Thread mercado
Thanks Tim and Gabriel! That was exactly what I needed -- http://mail.python.org/mailman/listinfo/python-list

Re: Using struct to read binary files

2009-11-26 Thread Tim Chase
f = open("/tmp/mbrcontent", "rb") contents = f.read() f.close() firstSectorAddress = contents[454:458] numSectors = contents[458:462]

Re: Using struct to read binary files

2009-11-26 Thread Gabriel Genellina
En Thu, 26 Nov 2009 22:59:29 -0300, mercado escribió: Hello, I am writing a Python program to read the Master Boot Record (MBR), and I'm having trouble because I have no previous experience reading binary files. First off, I've written a binary file containing the MBR to disk using the foll

Using struct to read binary files

2009-11-26 Thread mercado
Hello, I am writing a Python program to read the Master Boot Record (MBR), and I'm having trouble because I have no previous experience reading binary files. First off, I've written a binary file containing the MBR to disk using the following command: sudo dd if=/dev/sda of=/tmp/mbrcontent bs=1 c