On Thu, 02 Aug, Farshid Lashkari wrote:
> You cannot use PyRun_SimpleString, since it will automatically print
> and clear the error. You will need to use PyRun_String instead.
Thanks, that helps a lot!
--
Stefan Bellon
--
http://mail.python.org/mailman/listinfo/python-list
Stefan Bellon wrote:
> Thanks for your hints ...
>
> The interesting part is "Call python code". In my example this is done
> with PyRun_SimpleString which does not return if an exception is not
> handled but raised "out of" the interpreter. So I am unsure of what you
> mean with "Call python code
On Thu, 02 Aug, Farshid Lashkari wrote:
> Also, here is some sample code that will catch system exit exceptions:
>
> //Call python code
> ...
> //Check for system exit exception
> if(PyErr_Occurred()) {
> if(PyErr_ExceptionMatches(PyExc_SystemExit)) {
> //handle system exit
>
First of all, I'm sorry to followup my own posting, but I can add a few
things ...
On Thu, 02 Aug, Stefan Bellon wrote:
> As in Python itself you can catch SystemExit, I think this should be
> the way to go. But how do I catch this exception from within the C
> API?
I now installed an exception
Stefan Bellon wrote:
> Hi all!
>
> I am embedding Python into a GUI application in a way that the GUI is
> scriptable using Python.
>
> Now I have come to a problem that when the user puts a "sys.exit(0)"
> into his script to end the script, not only the script is terminated,
> but also the GUI a
Hi all!
I am embedding Python into a GUI application in a way that the GUI is
scriptable using Python.
Now I have come to a problem that when the user puts a "sys.exit(0)"
into his script to end the script, not only the script is terminated,
but also the GUI application itself. This is not the in