check if file is MS Word or PDF file

A. Joseph joefazee at gmail.com
Sat Sep 27 17:43:02 EDT 2008


What should I look for in a file to determine whether or not it is a
MS Word file or an Excel file or a PDF file, etc., etc.? including Zip
files

I don`t want to check for file extension.
os.path.splitext('Filename.jpg') will produce a tuple of filename and
extension, but some file don`t even have extension and can still be read by
MS Word or NotePad. i want to be 100% sure of the file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080927/3980f9c9/attachment.html>


More information about the Python-list mailing list