Oh, i'm sorry.

I've read the README, but haven't noticed that

m.from_buffer(open("testdata/test.pdf").read(1024))

was exactly what i was looking for.

Ok, i'll try it and let you know :D

2009/9/18 Kent Johnson <[email protected]>:
> On Fri, Sep 18, 2009 at 2:21 PM, [email protected] <[email protected]> wrote:
>> Hi Emile,
>>
>> that functions requires a filename/path.
>
> Did you even look at the link? There is a from_buffer() method also.
>
> Kent
>
>> 2009/9/18 Emile van Sebille <[email protected]>:
>
>>> I'd take a look at python-magic at
>>> http://hupp.org/adam/hg/python-magic/file/d3cd83e5a773 where the example
>>> shows that you can do:
>>>
>>> # For MIME types
>>>>>> mime = magic.Magic(mime=True)
>>>>>> mime.from_file("testdata/test.pdf")
>>> 'application/pdf'
>
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to