[Tutor] [Linux] open a file in any home "~" ?
learner404 at gmail.com
Wed Apr 19 20:40:52 CEST 2006
It works great, thanks very much to the three of you for these light-speed
answers ... I love this list !
Wesley, I've just pre-order your new edition "Core Python programming" on
amazon France, it looks great. :)
On 19/04/06, w chun <wescpy at gmail.com> wrote:
> > f=open("~/.myapp.conf","r") # but it returns a IOError: [Errno 2] No
> > file or directory:
> > How can I do to access this file whatever the user is ?
> use os.path.expanduser(path)
> hope this helps!
> -- wesley
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "Core Python Programming", Prentice Hall, (c)2007,2001
> wesley.j.chun :: wescpy-at-gmail.com
> python training and technical consulting
> cyberweb.consulting : silicon valley, ca
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor