Using os.popen3() to get binary data

MRAB google at mrabarnett.plus.com
Fri Apr 6 22:24:49 EDT 2007


On Apr 6, 6:09 pm, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On 6 Apr 2007 04:02:52 -0700, "Christoph Krammer"
> <redtige... at googlemail.com> declaimed the following in comp.lang.python:
>
> > Hello everybody,
>
> > I need to get the different frames from a GIF image in my python
> > script and want to use the giftopnm program from netpbm to get the
> > frames and directly convert them to pnm files. I tried to use the
> > following code:
>
> > for image in images:
> >     if (image[0:3] == 'GIF'):
>
>         What type of data /is/ "image" that the FIRST three characters
> identify the type? If it's the name of the file (I don't know what
> giftopnm requires for input) I'd have expected the last three to
> identify..
>
[snip]
FYI, the first 3 bytes of a GIF image are the ASCII characters "GIF".




More information about the Python-list mailing list