I'm using portable-python and haven't been able to find a way of linking .py files to the portable-python interpreter (meaning I can't just double click my scripts to run them). I've been getting around this by dragging scripts into the path portable-python checks and then importing them.
ex:
import random_py_file
but is there a way to substitute the name of the file with its absolute/relative path?
ex:
import C:\file\script.py
1 Answer 1
This works on linux; however, I am not sure about windows. Essentially what you are doing is adding a path where python will look to find your script.
sys.path.append('C:\file')
import script
Look here to find how to make this permanent.