title: How to append multiple Paths to PYTHONPATH programmatically
body: <p>I have 4 directories:</p>
  
  <pre><code>/home/user/test1
  /home/user/test2
  /home/user/test3
  /home/user/test4
  </code></pre>
  
  <p>I have another directory with tests</p>
  
  <pre><code>/home/user/testing
  </code></pre>
  
  <p>having the file testall.py</p>
  
  <p>ow, how can I append PATHS, for test1 thru test4 to PYTHONPATH so that I can access the files under test1 thru 4.</p>
  
  <p>btw, test1 thru 4 have multiple directories under them where the python files are located.</p>
  
  <p>I tried:</p>
  
  <pre><code>import sys
  import os
  PROJECT_ROOT = os.path.dirname(__file__)
  sys.path.insert(0,os.path.join(PROJECT_ROOT,"test1"))
  sys.path.insert(1,os.path.join(PROJECT_ROOT,"test2"))
  sys.path.insert(2,os.path.join(PROJECT_ROOT,"test3"))
  sys.path.insert(3,os.path.join(PROJECT_ROOT,"test4"))
  </code></pre>
  
  <p>did not seem to work</p>
  
  <p>also:</p>
  
  <pre><code>import sys
  sys.path.append('/home/user/test1','/home/user/test2','/home/user/test3','/home/kahmed/test4')
  from test1.common.api import GenericAPI
  </code></pre>
  
  <p>did not work.</p>
  
  <p>basically:
  from test1.common.api import GenericAPI
  should work</p>