John Mark Agosta wrote:

>
> Where is there a Python function to write binary data directly instead 
> of ascii (or other encodings)?  The pickle module binary format is 
> specific to pickle - that doesn't count, I want to be able to specify 
> the individual bytes written to a file.

Use 'struct.pack' and then write to a file opened in binary mode
open('foo.dat', 'wb').write(struct.pack(...))

--david ascher

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to