There are two ways to import manually in Python (depending on your version of python).
# Python2 import os os.chdir('/path') handle = __import__('scriptname')
Or you can do:
# Python3.3+ import importlib.machinery loader = importlib.machinery.SourceFileLoader("namespace", '/path/scriptname.py')
In the previous version of Python3, this is a bit different, now you do not have time or access to install older versions, but I remember that I had several problems when trying to import and especially reload the modules in earlier versions.
To reload these modules if they change (just to develop this answer):
Torxed
source share