title: Is it possible to import a module in python without using "import" or "eval"?
body: <p>I am designing a system that will run user submitted python script on a server. The script is meant to have access to only a couple of white-listed modules and nothing else. </p>
  
  <p>One approach to implementing such system securely is to build a custom python interpreter by removing all modules and overriding the underlying mechanism of "import" so that only selected modules can be imported, as explained <a href="http://svn.python.org/projects/python/branches/bcannon-objcap/securing_python.txt" rel="nofollow">here</a>. But this approach will require a lot of work on my part.</p>
  
  <p>Another approach is to pre-process the script and check for the presence of keywords "import" and "eval" keywords. If those keywords are present, the script won't be run and alarms will go off. But is there any other way by which one can still import a module and do malicious things?</p>