What command do you mean when you say "update main_dict with dlfl_dict"?
I tried PyObject *rstring = PyRun_String( cmd, Py_file_input, dlfl_dict, dlfl_dict ); This worked, but has the side effect of not allowing other commands like "execfile" I was able to type that before, but now it just says "name 'execfile' is not defined" Thanks for your help! :) On Jul 4, 10:23 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Stuart <[EMAIL PROTECTED]> wrote: > > ... > > > PyObject *rstring = PyRun_String( cmd, Py_file_input, main_dict, > > dlfl_dict ); > > You're passing difl_dict as the "locals" to PyRun_String -- but a > function has its own locals, so it won't use those locals. Just update > main_dict with difl_dict (that's the equivalent of the "from difl import > *" which you appear to desire) and use main_dict for both globals and > locals in your PyRun_String call. > > Alex -- http://mail.python.org/mailman/listinfo/python-list