title: how to "reimport" module to python then code be changed after import
body: <p>I have a <code>foo.py</code></p>
  
  <pre><code>def foo():
      print "test"
  </code></pre>
  
  <p>In IPython I use:</p>
  
  <pre><code>In [6]:  import foo
  In [7]:  foo.foo()
  test
  </code></pre>
  
  <p>Then I changed the <code>foo()</code> to:</p>
  
  <pre><code>def foo():
      print "test changed"
  </code></pre>
  
  <p>In IPython, the result for invoking is still <code>test</code>:</p>
  
  <pre><code>In [10]:  import foo
  In [11]:  foo.foo()
  test
  </code></pre>
  
  <p>Then I use:</p>
  
  <pre><code>In [15]: del foo
  In [16]:  import foo
  In [17]:  foo.foo()
  test
  </code></pre>
  
  <p>I delete the <code>foo.pyc</code> in same folder <code>foo.py</code> exists, but still no luck.</p>
  
  <p>May I know how to reimport the updated code in runtime?</p>