Archives and magic bytes

Maxim Krikun maxim.krikun at gmail.com
Wed Mar 23 20:50:46 EST 2005


> Another thing, I work on linux (gentoo) and I would like to use the
"file" command to retrieve informations about type of file instead of
using extensions, do you think this can be done?

this is trivial:

>>> import os
>>> os.popen("file /etc/passwd").read()
'/etc/passwd: ASCII text\n'




More information about the Python-list mailing list