Re: check if file is MS Word or PDF file

2008-09-27 Thread Michael Crute
On Sat, Sep 27, 2008 at 7:01 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > Looking at the docs for the mimetypes module, it just guesses based on > the filename (and extension), not the actual contents of the file, so > it doesn't really help the OP, who wants to make sure their program > isn't mis

Re: check if file is MS Word or PDF file

2008-09-27 Thread Sean DiZazzo
On Sep 27, 4:01 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Sat, Sep 27, 2008 at 3:42 PM, Michael Crute <[EMAIL PROTECTED]> wrote: > > On Sat, Sep 27, 2008 at 5:43 PM, A. Joseph <[EMAIL PROTECTED]> wrote: > >> What should I look for in a file to determine whether or not it is a > >> MS Word

Re: check if file is MS Word or PDF file

2008-09-27 Thread Chris Rebert
On Sat, Sep 27, 2008 at 3:42 PM, Michael Crute <[EMAIL PROTECTED]> wrote: > On Sat, Sep 27, 2008 at 5:43 PM, A. Joseph <[EMAIL PROTECTED]> wrote: >> 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 >> file

Re: check if file is MS Word or PDF file

2008-09-27 Thread Michael Crute
On Sat, Sep 27, 2008 at 5:43 PM, A. Joseph <[EMAIL PROTECTED]> wrote: > 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.jp

Re: check if file is MS Word or PDF file

2008-09-27 Thread Chris Rebert
On Sat, Sep 27, 2008 at 2:43 PM, A. Joseph <[EMAIL PROTECTED]> wrote: > 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.jp

check if file is MS Word or PDF file

2008-09-27 Thread A. Joseph
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