#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    100
    Rep Power
    2

    What’s the difference between PYTHONPATH, home directory, and sys.path?


    My presumption is that home directory is the directory where your interpreter is install--no, I guess that’d be the installation directory…and PYTHONPATH == sys--I don’t know, I am confused; plz, someone explicitly explain me the difference between the three…four, include the installation directory as well.
    Thanks, in advance.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Iran
    Posts
    149
    Rep Power
    139
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    100
    Rep Power
    2
    Originally Posted by dariyoosh
    Ya....I have already tried that and didn't get a thing that's why I turned here.
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    When you log on to your operating system, be it windows or unix, and you haven't got a funky startup script, sticks you in a default directory. That's your home directory.

    The python sys.path is a list of directories python uses to search for modules when executing your dear import statements.

    PYTHONPATH is an environment variable that extends sys.path. Thus you can externally affect sys.path . For instance, to give myself easy access to my personal python library I set
    $ echo $PYTHONPATH
    /home/lambertdw/bin/python3/src:
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo