What is the appropriate way to close the viewer and return control to the calling program? I naively guessed using the viewer’s close() method, but this doesn’t work, as the following code never reaches the print statement (although it does close the window). What method should be called to end the with block?
import napari with napari.gui_qt(): viewer = napari.Viewer() viewer.close() print("end")
In case it matters, I’m running this script directly from the command line, not an ipython session or jupyter notebook.