title: How to de-import a Python module?
body: <p>I am in the process of coding an app which has to get the metadata (author,version..etc) out of several modules (.py files) and display them.  The user selects a script and the script is executed.  (New scripts can be added and old ones be taken of from the target folder just like a plugin system).</p>
  
  <p>Firstly I import a script and I take out the metadata, then I go for the next.
  But I  want to de-import all the other modules except for the one that the user has selected.</p>
  
  <p>How can I implement this?</p>
  
  <p>I tried these</p>
  
  <pre><code>1. del module
  2. del sys.modules['module']
  </code></pre>
  
  <p>The latter did not work.  I tried #python and got the answer that it was not good to de-import modules, but I want to know a clean way of implementing this.  Any ideas/suggestions would help.</p>