title: Share python objects between two (or more) .py files
body: <p>I'd like to be able to run a python file (<code>file1</code>) that simply loads several large files into memory as python objects, then, with a different python file (<code>file2</code>), access those same objects without having to reload the files into memory a second time. <em>The motivation is that I want to be able to iteratively modify/develop <code>file2</code> without having to waste time reloading the same large files on every iteration.</em></p>
  
  <p>In a Jupyter notebook this is easily accomplished by running a cell that loads the files once; these objects are then accessible to all other cells in the notebook. I'd like to be able to establish this same cross talk between separate python files.  </p>
  
  <p><strong>Is there a way to establish the within-notebook Jupyter style cell-to-cell sharing of python objects between separate .py files?</strong></p>
  
  <hr>
  
  <p>(Edited to include an example)</p>
  
  <p>Below is an example scenario; let's say there are two files:</p>
  
  <p><code>file1.py</code>:</p>
  
  <pre><code>from sklearn.externals import joblib
  q = joblib.load('large_dict') #load a large dictionary that has been saved to disk; let's say it takes 2 minutes to load
  p = joblib.load('large_dict2') #load another large file; another 2 minutes load time
  </code></pre>
  
  <p><code>file2.py</code>:</p>
  
  <pre><code>#notice that the q, p objects are never loaded, but they are accessible 
  #(this is possible if the contents of these py files are in separate cells
  #in a Jupyter notebook)
  for experiment, chromosome in q.iteritems():
      #stuff to work with dict object
  for experiment, chromosome in p.iteritems():
      #stuff to work with dict object
  </code></pre>
  
  <p>I want to do</p>
  
  <p><code>python file1.py</code></p>
  
  <p><strong>once</strong>, and then do</p>
  
  <p><code>python file2.py</code>  </p>
  
  <p>an arbitrary number of times (i.e. iteratively modify the code in <code>file2</code>). Notice that in this scenario the objects created in <code>file1.py</code> are accessible to <code>file2.py</code>. My question is: <strong>Is this scenario possible?</strong></p>