En Thu, 12 Apr 2007 20:16:28 -0300, Daniel Nogradi <[EMAIL PROTECTED]>  
escribió:

>> Is there an easy way to take binary data and build it into a file?
>
> myblob = ......... # let's say you got it from your database somehow
> myjpeg = open( 'image.jpg', 'w' )
> myjpeg.write( myblob )
> myjpeg.close( )

For some platforms using open(..., "wb") is important, and won't hurt on  
the others, so it's the preferred way.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to