Le vendredi 08 septembre 2006 13:41, Sybren Stuvel a écrit :
> > HOME = os.path.expanduser("~")
>
> I wouldn't use this. Just use os.environ['HOME']. In most cases it
> turns out to be the same directory, but it adds more flexibility. If
> someone wants your app to read/write to another directory, he/she can
> simply change the HOME environment variable.

and ?

[EMAIL PROTECTED] jeu sep 07 09:17:51:~/test$ export HOME=/etc
[EMAIL PROTECTED] ven sep 08 13:53:17:/home/maric/test$ cd ~
[EMAIL PROTECTED] ven sep 08 13:53:22:~$ pwd
/etc
[EMAIL PROTECTED] ven sep 08 13:55:46:~$ python -c 'import os
> print os.path.expanduser("~")
> '
/etc


-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to