[Tutor] Linux Home directory

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Mar 13 10:53:11 EST 2004


> import commands
> x= commands.getstatusoutput('echo $HOME')
>  
> x[1] gives the value of required directory as string.

Or just use 

d = os.getenv('HOME')

Alan G.





More information about the Tutor mailing list