2

PYTHON 3.3 I have my HDD partitioned with programmes on "C" and data on "D" one NTFS and the other fat32. I've downloaded examples of code from one of the popular manuals onto "D". Running sys.path does not show these. I've looked, but cannot find the sys.path file to permanently add my "path". I can have the sys.path come up in IDLE, but making changes here are only temporary I believe. It is a small irritation to have to "go looking" each time. I'd really appreciate some comments, and apologize if this has already been answered somewhere else.

2
  • Thank you "poke" and "kHr" for your answers. I really appreciate them. Commented Apr 8, 2014 at 22:09
  • If an answer helped you to solve your problem please accept it to mark the question as resolved. In addition, you can upvote answers to express your gratitude. Commented Apr 8, 2014 at 22:14

2 Answers 2

2

You can modify the environment variable PYTHONPATH to adjust the default path Python looks for modules when importing.

Sign up to request clarification or add additional context in comments.

Comments

0

For instance, to add the directory /home/me/mypy to the path, just do:

import sys

sys.path.append("/home/me/mypy")

source: http://www.johnny-lin.com/cdat_tips/tips_pylang/path.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.