There seems to be 2 different ways to start a Python QGIS standalone script. The official tutorial is using :
from qgis.core import * # supply path to where is your qgis installed QgsApplication.setPrefixPath("/path/to/qgis/installation", True) # load providers QgsApplication.initQgis()
But I have also seen code looking like this :
from qgis.core.contextmanagers import qgisapp with qgisapp() as app: #do stuff
I didn't see any reference to the latter method on the official doc.
Does anybody know if there is a difference between the two ?