Try:
os.path.expanduser('~/.programname')
On linux, this will return:
>>> import os >>> os.path.expanduser('~/.programname') '/home/user/.programname'
In windows, this will return:
>>> import os >>> os.path.expanduser('~/.programname') 'C:\\Documents and Settings\\user/.programname'
This is a little ugly, so you probably want to do this:
>>> import os >>> os.path.join(os.path.expanduser('~'), '.programname') 'C:\\Documents and Settings\\user\\.programname'
EDIT: for what, the following applications on my Windows computer create their own configuration folders in my Documents and Settings\user folder:
- Android
- AgroUML
- Gimp
- Ipython
EDIT 2: Oh, I just noticed that instead of /user/.programname , /home/user/.programname was placed /user/.programname . Fixed.
source share