where should config files go in Windows?

Mike C. Fletcher mcfletch at rogers.com
Mon Feb 2 20:25:12 CET 2004


Russell E. Owen wrote:
...

>For unix and MacOS X I store settings in ~/.TUIPrefs and ~/.TUIGeom and 
>allow extensions to be stored in ~/TUIAdditions/ and <app's parent 
>dir>/TUIAdditions/.
>
>Is the home dir easily accessible from vanilla Python (and if so, how do 
>I get there)? Is there a better directory (I'm really not keen to mess 
>with the registry) or some special add-on library that I'll need?
>  
>
There are actually multiple directories for this kind of thing, 
depending on whether you're describing user's documents, 
application-specific data for the user (e.g. custom dictionaries), 
common application-specific data (app-specific system dictionaries), 
etceteras.  You can see an example of retrieving the user's 
application-specific data directory here:

http://cvs.sourceforge.net/viewcvs.py/pyopengl/OpenGLContext/browser/homedirectory.py?view=markup

using either of _winreg (standard module) or win32com's shell (common 
add-on, part of win32all).

See the MSDN documentation for the various folders which are defined.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetfolderpath.asp

>Also, is there something simple like unix's leading "." that makes 
>Windows files invisible?
>  
>
Haven't tried to do this myself.  But then I hate "hidden" files enough 
to simply disable hiding them in the explorer, so who knows, maybe I 
hide them all the time :) .  On windows it's more common to just put the 
file in the correct directory, where they are "out of the way", instead 
of dumping them into a "home" directory and hiding them.

Good luck,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/






More information about the Python-list mailing list