Py_Exit if "exit" not required 
Author Message
 Py_Exit if "exit" not required

I've just been starting to look at using python as an embedded language, and
the example given uses Py_Exit() (aka goaway()) to "close down" the
interpreter. Looking at the source, it is evident that Py_Exit() does rather
more than just call Py_Cleanup() and then exit(). But I can't see a call that
allows one to close down the interpreter WITHOUT exiting - something that
seems an obvious need in an embedded situation, where the controlling software
likely wants to control program exit itself.

Would it be possible/sensible to make Py_Exit() be *actually* a call to
Py_???() followed by exit(), where ??? is some appropriate string (such as
"CloseDown" or something)? Or am I being unnecessarily stupid?

(Yes, I realise that one does not *have* to exit Python at the end of one's
software, but it's neater if one can, and also, what if one wants to close
down the interpreter *before* the end of execution?)


Sun, 07 Mar 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

2. What replaces "EXIT"?

3. problem with "exiting".........

4. When to run "exit" code

5. Changing "exit" command in Tcl

6. QUESTION: TK "exit" window control

7. Q: "on exit" processing

8. Disabling "X" exit button on toplevels

9. catch: removing "child process exited abnormally"

10. cgi-bin "exec": error waiting for process to exit: No child processes

11. Unexpected behavior from $interp eval "exit"

12. Embedding Tcl -- "exit" and proper cleanup


Powered by phpBB® Forum Software