title: Common Python scripts are getting called multiple times
body: <p>I have the following project structure.</p>
  <pre><code> - README.rst
   - LICENSE
   - setup.py
   - requirements.txt
   - common_prj/__init__.py
   - common_prj/common_lib.py
   - common_prj/config.xml
   - Project1/__init__.py
   - Project1/some_app_m1.py
   - Project1/some_app_m2.py
   - Project1/some_app.py
   - Project2/some_app1.py
  </code></pre>
  <p>I am having all my common classes in common_prj/common_lib.py file. Now each module file from Project1 is calling common_prj/common_lib.py to access common classes and setup project env using config.xml</p>
  <p>#import in some_app_m1.py</p>
  <hr />
  <pre><code>from common_prj import common_lib
  </code></pre>
  <p>#import in some_app_m2.py</p>
  <hr />
  <pre><code>from common_prj import common_lib
  </code></pre>
  <h2>Imports in some_app.py</h2>
  <hr />
  <pre><code>from Project1 import some_app_m1
  from Project1 import some_app_m2 
  from common_prj import common_lib
  ###
    &lt;some functions&gt;
    &lt;some functions&gt;
  ###
  if __name__ == '__main__':
  </code></pre>
  <p>With the above three import it seems common_lib.py is getting executed multiple time , but if I keep the common_lib.py in Project1 then I don't see this issue.</p>
  <p>Please let me now how can I keep common_lib.py in common package and call that from Project1 scripts without executing it multiple time. The purpose of common_lib.py is to share common classes with scripts in Project2.</p>
  <p>I have the below code in common_lib.py which is repeating for calling classes from each module after import.</p>
  <hr />
  <pre><code>self.env = dict_env.get(int(input(&quot;Choose Database ENV for this execution : \n&quot; + str(dict_env) + &quot;\nSelect the numeric value =&gt; &quot;)))
  self.app = dict_app.get(int(input(&quot;Choose application for this execution : \n&quot; + str(dict_app) + &quot;\nSelect the numeric value =&gt; &quot;)))
  </code></pre>
  <hr />
  <p><strong>My question why I am not facing this issue if I keep common_lib.py in Project1 rather common_prj. I added the above code in common_lib.py because I don't wanted to repeat these lines and ENV setup in my all app code. These are global env settings for all application scripts code inside Project1.</strong></p>
  <hr />
  <p><strong>output</strong></p>
  <hr />
  <pre><code>Choose Database ENV for this execution : 
  {1: 'DEV', 2: 'SIT', 3: 'UAT', 4: 'PROD'}
  Select the numeric value =&gt; 1
  Choose application for this execution : 
  {1: 'app1', 2: 'app2', 3: 'app3', 4: 'app4', 5: 'app5', 6: 'app6'}
  Select the numeric value =&gt; 1
  Choose Database ENV for this execution : ### Here it is repeating again from common_lib.py
  {1: 'DEV', 2: 'SIT', 3: 'UAT', 4: 'PROD'}
  Select the numeric value =&gt; 1
  Choose application for this execution : ### Here it is repeating again from common_lib.py
  {1: 'app1', 2: 'app2', 3: 'app3', 4: 'app4', 5: 'app5', 6: 'app6'}
  Select the numeric value =&gt; 1
  </code></pre>