home variable?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BurnTard
    New Member
    • May 2007
    • 52

    home variable?

    The internet is terrible for searching for these kinds of things... How do I get the home variable in python again? Like, if the program is run on an unix system, it'll return /home/user, and on windows it'll return c:\Documents and Settings\User or something like that?
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Builtin os.environ returns a dictionary of environment variables. On my system (XP), the dictionary key is 'USERPROFILE' or 'HOMEDRIVE' + 'HOMEPATH'.

    Comment

    • BurnTard
      New Member
      • May 2007
      • 52

      #3
      Thanks! That's going to be a great help in the future!

      Comment

      Working...