windows - Find system folder locations in Python -


i trying find out location of system folders python 3.1. example "my documents" = "c:\documents , settings\user\my documents", "program files" = "c:\program files" etc etc.

i found a different way of doing it. way give location of various system folders , uses real words instead of clsids.

import win32com.client objshell = win32com.client.dispatch("wscript.shell") alluserdocs = objshell.specialfolders("allusersdesktop") print alluserdocs 

other available folders: allusersdesktop, allusersstartmenu, allusersprograms, allusersstartup, desktop, favorites, fonts, mydocuments, nethood, printhood, recent, sendto, startmenu, startup & templates


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -