small question

Jarek Zgoda jzgoda at usun.gazeta.pl
Sun Mar 16 06:18:31 EST 2003


Ali Dada <afd00 at aub.edu.lb> pisze:
 
> how can i force a script to execute in the user's home directory?
> if i know that the user is 'foo' i can say 
>>os.chdir('/home/foo')
> but what is a better and more general way?

Look at other os.* routines - i.e. os.path.expanduser(). You can also
read $HOME env. variable.

-- 
Jarek Zgoda
http://www.zgoda.biz/                        JID:zgoda at jabber.atman.pl




More information about the Python-list mailing list