title: Dynamically importing Python module
body: <p>I have a trusted remote server that stores many custom Python modules. I can fetch them via HTTP (e.g. using <code>urllib2.urlopen</code>) as text/plain, but I cannot save the fetched module code to the local hard disk. How can I import the code as a fully operable Python module, including its global variables and imports?<br>
  I suppose I have to use some combination of <code>exec</code> and <code>imp</code> module's functions, but I've been unable to make it work yet.</p>