I\'ve recently began using ConfigParser() for my python scripts to add some functionality to them for config files. I know how to use it but I have a problem. My script need
This doesn't work.
homepath = os.path.expanduser("~/")
So don't use it.
You want this.
username= os.environ["LOGNAME"]
homepath = os.path.expanduser("~"+username+"/")
http://docs.python.org/library/os.html#os.getlogin
Or perhaps this.
username= pwd.getpwuid(os.getuid())[0]
homepath = os.path.expanduser("~"+username+"/")