python-magic
Posted on Mon, 23 Aug 2010 00:49:29 +0900
忘れるのでメモる。 libmagicのPython用ラッパー。
$ pip install python-magic
$ python
>>> import magic
>>> magic.from_file('/tmp/main.c')
'ASCII C program text'
>>>
忘れるのでメモる。 libmagicのPython用ラッパー。
$ pip install python-magic
$ python
>>> import magic
>>> magic.from_file('/tmp/main.c')
'ASCII C program text'
>>>