Writing binary files

Ben Wolfson rumjuggler at cryptarchy.org
Fri Sep 14 08:05:55 CEST 2001


On Fri, 14 Sep 2001 04:47:42 GMT, leind at sofcom.com wrote:

>Does python have the ablitiy to open a file and write
>binary data to it?

Yes.  Use the built-in open() function.  For portability you should specify
"wb" (to specify that you're opening the file to write binary data) as the
second argument, though if you'll only use the script on Linux I understand
that simply opening the file for writing with "w" will work.

-- 
Barnabas T. Rumjuggler
You're going to set me up as a kind of slovenly attached pig that
Jack Kornfeld can slice down in his violent zen compassion?
 -- Larry Block



More information about the Python-list mailing list