Just noticed a big discrepancy with
sys.exit(). Consider the following script:
import sys sys.exit()
When running from the Script Editor,
sys.exit() terminates the script (which is what I would expect from the docs), but if make it an IJ command by e.g., saving it as
Fiji.app/plugins/Scripts/sys_exit_test.py, ImageJ will quit without any warning.
This happens if the script is called either through:
- Menu hierarchy: Plugins > Scripts > sys exit test
- Command Launcher
- A macro, e.g.,
run("sys exit test");
I’m guessing this is not intentional? It is quite an aggressive behavior. I’m imagining all sorts of scenarios where this could make someone loose all of its work inadvertently.
BTW, it does not seem to happen, through the IJ1
eval() macro function:
eval("python", "import sys" + "\n" + "sys.exit()");