[python-win32] Python-win32 Digest, Vol 36, Issue 11

James Carroll mrmaple at gmail.com
Fri Mar 10 18:48:28 CET 2006


> >
> >I'm changing my
> >strategy to simply let them choose from a list of directories under
> >Documents and Settings instead.
>
> That's not entirely reliable.  One of my partners, a man who HATES
> spaces in file names, used the "tweakui" utility to rename all of the
> special directories, so he doesn't even HAVE a "Documents and Settings"
> folder.  His "application data" directory is something like "c:\apps\data".
>

Cool, I might just do that myself.  My "My Documents" directory is
C:\jimc and I really like it like that.

As long as his ALLUSERSPROFILE is right, then my code should work:

        allUsersAppData = os.environ["ALLUSERSPROFILE"]
        # dns = Documents and Settigns usually
        dns = os.path.join(allUsersAppData, "..")
        (root, subdirs, files) = os.walk(dns).next()

        dlg = wx.lib.dialogs.MultipleChoiceDialog(self,
          "Choose the user's profile directory"
          "Migrate settings for a user", subdirs, (200,200))

Whadayathink?
-Jim


More information about the Python-win32 mailing list