I looked at the QGIS official documentation (e.g., Using PyQGIS in custom applications) and a few questions here (e.g. Running QGIS through Python), but I was unable to find an example of a Python script that starts a regular QGIS app.
In other words, I look for the 'official'/recommended way to replicate the same results of running QGIS.exe
(splash screen, main window visualization, etc.) using a qgis.py
instead (i.e., without calling a QGIS executable using subprocess):
import logging
from qgis import core
logger = logging.getLogger(__name__)
def main():
qgis_version = core.Qgis.version()
logger.info('Running QGIS v.%s ...' % qgis_version)
qg = core.QgsApplication([], True)
qg.initQgis()
# some code here that runs the QGIS splashscreen?
# some code here that shows the QGIS main window?
qg.exec_()
qg.exitQgis()
logger.info('Running QGIS v.%s ... DONE' % qgis_version)
(I am aware that it is possible to execute a startup.py, but this question is about writing a Python script that starts QGIS up.)