embedding interactive python interpreter

Eric Frederich eric.frederich at gmail.com
Sun Mar 27 23:06:47 EDT 2011


I'm not sure that I know how to run this function in such a way that
it gives me an interactive session.
I passed in stdin as the first parameter and NULL as the second and
I'd get seg faults when running exit() or even imnport sys.

I don't want to pass a file.  I want to run some C code, start an
interactive session, then run some more C code once the session is
over, but I cannot find a way to start an interactive Python session
within C that won't exit pre-maturely before I have a chance to run my
cleanup code in C.

On Sun, Mar 27, 2011 at 5:59 PM, eryksun () <eryksun at gmail.com> wrote:
> On Friday, March 25, 2011 12:02:16 PM UTC-4, Eric Frederich wrote:
>>
>> Is there something else I should call besides "exit()" from within the
>> interpreter?
>> Is there something other than Py_Main that I should be calling?
>
> Does PyRun_InteractiveLoop also have this problem?



More information about the Python-list mailing list