Open utterances-bot opened 3 years ago
Nice, a button appears under the "help" menu! As it only stays there for the current session, how can you make a such button permanent?
Hi @cforgaci, the reason why it is not permanent is because you need to run the script, to make it permanent I would assume you would have to make a plugin or something similar, so that it runs automatically everytime qgis is launched.
You would have to tell qgis somehow to run this script on every start. I don't know how to do that, but I assume it should be possible.
My QGIS version is 2.18.4, after running the gis.buttom.py, the console showed an error message:
Traceback (most recent call last):
File "", line 1, in
I got the same error as Cinco, I have the same version of Qgis
Hmm, yes my guess is that the issue comes from the fact that this script was written for QGIS version 3, so it may not work the same on version 2. I will do a little research to see if there's a quick change we can make so that it does work :)
@communisker and @LCarvalhoF to verify, are you opening this python script from your QGIS Python Code Editor? You will get an error if you try running it in the terminal...so I just wanted to double check. It looks like the QAction method is available in QGIS version 2, so that shouldn't be the error.
The workflow is:
Can you try those steps and let me know if it works?
This is an important point that we touched upon just briefly this morning - scripts written specifically for QGIS will not work outside of QGIS without some special formatting changes (or libraries that do it automatically). For now, we can run everything in QGIS.
I followed exactly the same steps and still get the same error.
@LCarvalhoF can you jump back into the office hours Zoom and we can take a look?
Running someone else’s Python script — Python essentials for GIS learners
https://the-magnificents.github.io/04-02-2021-Carpentry-for-HGIS/02_Day_2_Python_GIS/exercise/B0_exercise1_qgis.html