Dear fellow Python enthusiasts,<br><br>I trust your Thanksgiving holiday has been a relaxing one. A quick question for you: I have a script that attempts to import my_module from a folder that is not in Python's importable modules search path. In my script, that I run from the command line, I have the following lines:
<br><br>import os<br>import sys<br><br>PATH_TO_MODULE = os.path.join('path', 'to', 'my', 'module')<br>sys.append(PATH_TO_MODULE)<br><br>import my_module<br><br>When I attempt to run the script, I get the following error message:
<br><br>ImportError: No module named my_module<br><br>In Python IDLE when I perform the aforementioned steps in the order indicated I can import my_module successfully. My assumption is Python's importable modules search path is in
sys.path. In both cases I identify the path to the folder containing my module, I append said path to sys.path, and when I attempt to import my_module by either running from the command line or in IDLE, I get different behavior. I read the information here again:
<br><br><a href="http://docs.python.org/tut/node8.html">http://docs.python.org/tut/node8.html</a><br><br>so I believe I am doing everything correctly. Am I doing something wrong ?