How cleanly exit Python script without killing Moneydance

OK, so is there a clean way to abort a python script (from a sub function/method/class)? Normally one would use sys.exit(0) but this actually kills Moneydance, because python is being run as part of the core java package (I think)… So, is there a ‘special’ abort built into Moneybot to kill the script and return to Moneybot? If not, perhaps Moneybot could define a special function / class / somwthing that python scripts can call to terminate the script cleanly? At the moment I just put ABORT which of course causes the Moneybot script runner to crash… Or Raise (exception). These both abort the script, but of course will the usual stack trace etc - Not very clean. Of course I know that I can maintain a variable and keep checking that and build a complex layer of checks to get back up to the main level, but that seems like hard work.... Thoughts?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac