title: Initializing global variables using Python 3 import
body: <p>What I'm trying to do may be easier to explain by example. Consider the following code:</p>
  
  <p>In file my_custom_module.py</p>
  
  <pre><code>def oop_type_a():
      __init__(self):
      # class definitions, etc...
  
  def oop_type_b():
      __init__(self):
      # class definitions, etc...
  
  def define_a_bunch_of_oop_variables():
      global oop1
      global oop2
  
      oop1 = oop_type_a()
      oop2 = oop_type_b()
  </code></pre>
  
  <p>Using this file, I can run these commands:</p>
  
  <pre><code>&gt;&gt;&gt;import my_custom_module
  &gt;&gt;&gt;my_custom_module.define_a_bunch_of_oop_variables()
  &gt;&gt;&gt;from my_custom_module import *
  
  &gt;&gt;&gt;oop1
  &lt;my_custom_module.oop_type_a object at 0x000000000615F470&gt;
  &gt;&gt;&gt;oop2
  &lt;my_custom_module.oop_type_a object at 0x000000000615F5C0&gt;
  </code></pre>
  
  <p>Is there a way to get this same functionality <strong>without</strong> the <code>from my_custom_module import *</code>? What is the pythonic way to achieve this?</p>
  
  <p>I have several objects that I need to initialize everytime I use this module, and doing this is tedious:</p>
  
  <pre><code>&gt;&gt;&gt;import my_custom_module
  &gt;&gt;&gt;oop1 = my_custom_module.oop_type_a()
  &gt;&gt;&gt;oop2 = my_custom_module.oop_type_b()
  </code></pre>