get Windows file type

2006-05-08 Thread BartlebyScrivener
Using Python on Windows XP, I am able to get almost all file and path info using os.path or stat, but I don't see a way to retrieve the file type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what is listed in the Type column in the Windows Explorer box. Thanks, rick --

Re: get Windows file type

2006-05-08 Thread Sybren Stuvel
BartlebyScrivener enlightened us with: Using Python on Windows XP, I am able to get almost all file and path info using os.path or stat, but I don't see a way to retrieve the file type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what is listed in the Type column in the Windows

Re: get Windows file type

2006-05-08 Thread dwelch
BartlebyScrivener wrote: Using Python on Windows XP, I am able to get almost all file and path info using os.path or stat, but I don't see a way to retrieve the file type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what is listed in the Type column in the Windows Explorer box.

Re: get Windows file type

2006-05-08 Thread Roger Upole
If you have pywin32 installed, you can use the shell module. from win32com.shell import shell, shellcon shell.SHGetFileInfo(filename ,0, shellcon.SHGFI_TYPENAME) Roger BartlebyScrivener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Using Python on Windows XP, I am able to get