Thank you!
Thank you!
try '~/.stuff'
I am infallible, you should know that by now.
"My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
(02:15:31 PM) ***TimToady and snake oil go way back...
42 lines of Perl - SHI - Home Site
Thank you for that suggestion.
I tried it with the following result
fpConf=open(CONFIG_FILE, "w")
IOError: [Errno 2] No such file or directory: '~/GPSBabelWrapper.conf'
Calling it ~GPSBabelWrapper.conf doesn't bring an error as doesn't GPSBabelWrapper.conf but as I wrote above both result in the file being written to the actual directory.
So what am I doing wrong.
Please help
Neill
Using /home/neill/GPSBabelWrapper.conf
works.
very strange
Last edited by NeillHog; November 18th, 2007 at 05:30 PM.
I don`t know if it is relevant but I am using Kubuntu. And I obviously have all rights on my home directory.
I thought that the tilde was equal to /home/neill
You need the full path since pythons "open()"-function will not do the "~" -> "/home/<current_user>/" mapping for you.
I know I have seen some kind of function for getting the current users home directory though. Use that instead. Is probably in the "os" module.
That worked !
configFile = os.path.expanduser("~") + '/GPSBabelWrapper.conf'
thanks!
Or you could make it even easier:
configFile = os.path.expanduser("~/.gpsbabelwrapper")
1) Configfiles are normally hidden. Let them start with a dot.
2) Files in Linux are usually not written with capitalized letters. Do a "ls -d .*" in your home directory and watch how the config files are named. Of the 130 hidden files in my home dir, there is not one single capitalized letter.
Good luck with your project.
OK! Thank you for both tips. It is the friendly, informed, helpfull users that make Ubuntu/Python so much fun.
T anks
Neill
Bookmarks