Python version of function for "GetApplicationDataFolder"


#1

Is there a Python equivalent to this function?:

Function GetApplicationDataFolder()
Const APPLICATION_DATA = &H1a&
Dim objShell, objFolder, objFolderItem
Set objShell = CreateObject(“Shell.Application”)
Set objFolder = objShell.Namespace(APPLICATION_DATA)
Set objFolderItem = objFolder.Self
GetApplicationDataFolder = objFolderItem.Path
End Function

Thanks,

Dan


(Dale Fugier) #2
import Rhino
import System
Rhino.RhinoApp.WriteLine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData))

(Steve Baer) #3

Just a note, print is the same as WriteLine so if you want to save some keystrokes on Dale’s sample

import System
print System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData)

#4

Thanks Dale and Steve. I will experiment with this tomorrow.

Dan