<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
WTF??<br>
Why on IDLE it works, but when i run this script in cmd.exe, the os.getenv('HOME') goes NoneType?<br>
I'm to newbie yet to understand this  :/<br>
</blockquote><div><br></div><div>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.</div>

<div><br></div><div>If you do os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] it may be what you want.</div><div><br></div><div>Start up cmd.exe, type 'set' -- that's the default/standard environment variables you have to work with. That's it.</div>

<div><br></div><div>--S</div></div>