Get Special Folders (ie Desktop location)

C

Colin Steadman

I'm just starting out writing Python scripts (in PSP), and need to
find the location of Windows special folders such as 'My Documents'
and 'Desktop' so that I can save files in the right place. Is there
any method I can use in Python to get these?

If I were doing this in VBScript it'd be:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
msgbox WSHShell.SpecialFolders("Desktop")

TIA,

Colin
 
P

Peter Hansen

Colin said:
I'm just starting out writing Python scripts (in PSP), and need to
find the location of Windows special folders such as 'My Documents'
and 'Desktop' so that I can save files in the right place. Is there
any method I can use in Python to get these?

If I were doing this in VBScript it'd be:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
msgbox WSHShell.SpecialFolders("Desktop")

Use COM:
u'C:\\Documents and Settings\\Colin\\Desktop'

-Peter

P.S.: Yes, I edited the result to look like yours might. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top