TypeError while checking for permissions with os.access() on windows xp
ryniek90 at gmail.com
Sat Aug 22 23:37:22 CEST 2009
> Why on IDLE it works, but when i run this script in cmd.exe, the
> os.getenv('HOME') goes NoneType?
> I'm to newbie yet to understand this :/
> HOME is simply not a standard environment variable that Windows
> provides. Any program can set/add environment variables as it deems
> fit; in this case it seems IDLE is setting one, but you can't rely on
> it outside of IDLE.
> If you do os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] it may be
> what you want.
> Start up cmd.exe, type 'set' -- that's the default/standard
> environment variables you have to work with. That's it.
Yep, now that variable works fine. Thanks.
More information about the Python-list