Re: [QGIS-Developer] passing parameters to QGIS Python-Script started via Command Line

2022-08-08 Thread Ujaval Gandhi via QGIS-Developer
One option is to set env variables before launching the qgis command. The env variables can be read from python. set QGIS_MESSAGE=Helllo World Then your myscript.py can be something like from qgis.utils import iface import os message = os.environ['QGIS_MESSAGE'] iface.messageBar().pushMess

Re: [QGIS-Developer] passing parameters to QGIS Python-Script started via Command Line

2022-08-08 Thread Matthias Kuhn via QGIS-Developer
Hi Peter, You are correct with the analysis of the situation. Even if `qgis --help` states the following: [--] treat all following arguments as FILEs it does in fact already interpret parameters as files before the `--` parameter. Changing this behavior is risky (it will break many startup scri

[QGIS-Developer] passing parameters to QGIS Python-Script started via Command Line

2022-08-08 Thread Drexel Peter via QGIS-Developer
Hi everyone, My goal: I want to open QGIS using the Command-Line, load a specific project, select specific features and zoom to the selected features. What sounds rather difficult is actually mostly solvable using the following: "C:\Program Files\QGIS 3.16\bin\qgis-ltr-bin.exe" -p "d:\standardeben