title: Python C API: How to get PyRun_String with Py_eval_input to use imported modules?
body: <pre><code>PyRun_String("random.randint(1,10)", Py_eval_input, globals, globals);
  </code></pre>
  
  <p>returns error with:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  NameError: name 'random' is not defined
  </code></pre>
  
  <p>earlier in the code, I did: </p>
  
  <pre><code>PyImport_ImportModule("random");
  </code></pre>
  
  <p>I guess this is not the way to get it work.  What is the correct way?
  Thank you!</p>