Because Microsoft will be removing vbScript in the next version of Windows, I have been busy converting my utility vbScripts into Python. Part of this is a library of functions that I keep in D:\include
. I'd like to maintain this system in Python, but the import process is rather clumsy. I have to
import sys
sys.path.insert(0,r'D:\include')
Only after that can I import a file. The documentation is somewhat obtuse but I gather my best option is to add the file D:\include__init__.py
. As long as that folder is known to Python I could then do
from include import myfile1
to include the file D:\include\myfile1.py
. The only problem is that I have yet to find a way to permanently add the include folder to the list of folders that Python searches. I'm sure there is a simple way. Anyone know what it is?