I would like to run a python script via
qgis --code myscript.py and then immediately exit. I'm using
iface.actionExit().trigger(), which kills QGIS when I run it from the python console, but not when put in the script that I pass to
What's the right way to immediately exit? I'm running QGIS 2.0.1
Update: I've also tried
sys.exit(). QGIS catches it and pops up a window with the following:
An error occured during execution of following code: execfile('myscript.py') Traceback (most recent call last): File "", line 1, in File "myscript.py", line 14, in sys.exit() SystemExit
os.kill(os.getpid(), 9) works but it's a dirty hack and I'm looking for something better.