title: How do I run Python script from a subdirectory?
body: <p>I want to be able to write a line of code like this and have it run smoothly:</p>
  
  <pre><code>python /path/to/python_file.py -arg1 -arg2 -etc
  </code></pre>
  
  <p>I figured out an easy way to discover all modules and add them to the current Python path, but it still doesn't seem to recognize the .py file, even though it's supposedly in the <code>sys.path</code>. I know the <code>sys.path</code> addition is working because I can perform this in the interpreter just fine:</p>
  
  <pre><code>&gt;&gt;&gt;import ModuleManager # My Python script to discover modules in lower directories
  &gt;&gt;&gt;import testModule # Module I want to run from lower directory
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named testModule
  
  &gt;&gt;&gt;ModuleManager.discoverModules() # Now, I find the modules and add them to path
  Discovering Modules...Complete!
  Discovered 6 Modules.
  &gt;&gt;&gt;import testModule # No error now.
  &gt;&gt;&gt;
  </code></pre>
  
  <p>What I would like to do at this point is be able to go into my terminal and say:</p>
  
  <pre><code>python testModule -arg1 -arg2 -etc
  </code></pre>
  
  <p>and have it perform how I would expect. </p>
  
  <p>To be clear, I want to write a line of code in <code>ModuleManager.py</code> (from my application root folder) that allows me to access a file named <code>testModule.py</code> which is found in <code>/root/path/to/testModule.py</code> in a way such that I can use arguments as in <code>python testModule.py -arg1 -arg2 -etc</code>. Any suggestions?</p>