get Windows file type

Roger Upole rupole at
Tue May 9 03:49:20 CEST 2006

If you have pywin32 installed, you can use the shell module.

from import shell, shellcon
shell.SHGetFileInfo(filename ,0, shellcon.SHGFI_TYPENAME)


"BartlebyScrivener" <rpdooling at> wrote in message news:1147089470.336984.173510 at
> 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

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

More information about the Python-list mailing list