Please help on Binary file manipulation

Looney, James B james.b.looney at
Tue Jun 5 17:19:46 CEST 2007

I've found when I have questions like this, that thinking about how I'd
do it in C/C++, then searching on some of those key words leads me to a
Python equivalent solution, or at least heading down the right path.
In this case, I believe you'll find the "file" module helpfull.  You can
read/seek on a number of bytes.  
I don't know how you'd do the playback specifically, but my guess is
you'll use a loop to create new files, so use a similar loop for


	From: at
[ at] On
Behalf Of Pieter Potgieter
	Sent: Tuesday, June 05, 2007 2:43 AM
	To: python-list at
	Subject: Please help on Binary file manipulation
	Hi all
	I have a binary file of about 600kbytes - I want to break it up
in file chunks of 1085 bytes - every file must have a new file name.
	The data is binary video frames (370 frames) - I want to play
the data back into an embedded system frame/file by file.
	I am a complete Python newby - but have C/C++ skills.
	Please supply/help me with an snippet or example 


	Disclaimer: The information contained in this communication is
confidential and may be legally privileged. 

	It is intended solely for the use of the individual or entity to
whom it is addressed and others authorised to receive it. 

	Any review, retransmission, dissemination, copying, disclosure
or other use of, or taking of any action in reliance upon, this
information by person or entities other then the intended recipient is

	If you have received this message in error, please notify the
sender immediately by e-mail, facsimile or telephone and return and/or
destroy the original message and all copies from any computer. 


	Denel (Pty) Ltd exercises no editorial control over e-mail
messages originating in the organisation and does not accept any
responsibility for either the contents of the message or any copyright
laws that may have been violated by the person sending this message. 

	Denel (Pty) Ltd is neither liable for the proper and complete
transmission of the information contained in this communication nor any
delay in its receipt. 

	This message should not be copied or used for any purpose other
than intended, nor should it be disclosed to any other person. 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list