I would like to terminate a Python script gracefully.  Both quit() and exit() not only abort the script but end the entire QGIS app.  For example, if a file I want to read doesn't exist, the following four lines of code terminate QGIS:

filePath = Path(fName)
if not filePath.is_file():
    print ('Unable to find file  ', fName)
    exit()

Substituting  quit() for exit()  doesn't help.  I could omit both, and put all of the remaining code under an "else" but that seems rather clunky.
  Any suggestions would be welcome.

_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to