Automatically creating a HOME environ variable on Windows?

Maciej Dziardziel fiedzia at fiedzia.prv.pl
Mon Oct 31 06:26:30 EST 2005


Jorgen Grahn wrote:

>> Best solution would be to have portable function that returns
>> user home directory and knows about all platfom quirks.
> 
> Why is that better than Python creating a HOME in os.environ, if it
> doesn't
> already exist?  I can think of a few reasons it's better, and a few
> reasons it's worse.

First, it is possible that HOME viariable already exists and has different
meaning, (if python is used as embedded scripting language it can be
defined by application), Second, there is a group of path related functions
in os.path (or ntpath), including expanduser, and its better to use
function than relay on some interpreter behaviour that may be different on
jython or ironpython.

-- 
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl

How come in Scooby Doo Fred and Daphne were always on the same team and   
   Velma, Scooby and Shaggy were always on the same team? Doesn't seem quite 
   right now that you think about it, does it?



More information about the Python-list mailing list