Python Intra-Package Imports - How do I get common functions/classes spread throughout my package?
<p>I have a set of python scripts organized like so:</p>

<pre><code>PythonScripts/
     TypeAScripts/
        TypeASet1Scripts/
            example.py
        TypeASet2Scripts/
     TypeBScripts/
        TypeBSet1Scripts/
        TypeBSet2Scripts/
     TypeCScripts/
        TypeCSet1Scripts/
        TypeCSet2Scripts/
     CommonFunctions/
        CommonFunctions.py
</code></pre>

<p>with <code>init.py</code> in every folder. What I want is to be able to run <code>example.py</code> where <code>example.py</code> imports from <code>CommonFunctions</code>. I want scripts throughout folders A,B, and C to do the same. </p>

<p>To do this with absolute imports, you'd put</p>

<pre><code> import PythonScripts.CommonFunctions.CommonFunctions 
</code></pre>

<p>However, this only works if <code>PythonScripts</code> is in your python path. Which, if you are just running <code>example.py</code> in that folder, isn't going to be the case. You can add it with <code>sys.append()</code>, but this seems like an awkward way of doing it. Is there any better approach?</p>
