I have figured out how to temporarily append the path dir
import os, sys
sys.path.append('c:\\code')
... But how do I add a file permanently? I tried the following...
import os, sys
set PYTHONPATH=%PYTHONPATH%;C:\code
If you want to avoid setting environment variables, you can add a folder to your path by creating a .pth file in the folder %APPDATA%\Python\Python34\site-packages (you may have to create the folder).
For example, with %APPDATA%\Python\Python34\site-packages\anything.pth containing the single line
c:\code
... and c:\code containg the file woof.py with the following line:
MIAOW = "chirrup"
... we can check that it all works:
>>> from woof import MIAOW
>>> MIAOW
'chirrup'
PATHin your Windows Settings somewhere.