Python, get windows special folders for currently logged-in user -


how can windows special folders documents, desktop, etc. python script? need win32 extensions?

it must work on windows 2000 windows 7.

you can pywin32 extensions:

from win32com.shell import shell, shellcon print shell.shgetfolderpath(0, shellcon.csidl_mypictures, none, 0) # prints c:\documents , settings\username\my documents\my pictures # (unicode object) 

check shellcon.csidl_xxx other possible folders.

i think using pywin32 best way. else you'd have use ctypes access shgetfolderpath function somehow (other solutions might possible these ones know).


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -