Geographic Information Systems Asked on March 12, 2021
I am an absolute beginner in QGIS no idea in this field.
I just created a Python plugin with pluging builder in QGIS successfully
PYTHON_PLUGINS_PATH/ MyPlugin/ —————– inside it contain these files
____init__.py
mainPlugin.py
mainPlugin_dialog.py
mainPlugin_dialog_base.ui
plugin_upload.py
README.txt
metadata.txt
resources.qrc
resources.py
resources_rc.py
.
.
etc
I just want to write some code like print(“hello world”).
I want to know should I write it inside the mainPlugin.py file If yes then ok, otherwise tell me where should write my code.
After writing my code how can I run It through my plugin which I created
in QGIS. I am seeing only my plugin name in QGIS my plugin has no option to import file to take this file mainPlugin.py and run it.
What is the procedure to run my mainPlugin.py file through my plugin inside QGIS?
If you have not already pip install pb_tool Get to the directory with your pb_tool.cfg file. You may have to modify the path: inside the pb_tool.cfg to point to your /plugins directory in QGIS3.4.
Then open your directory with your pb_tool.cfg file from the cmd line and type pb_tool deploy.
If that goes well you should have a new plugin in QGIS that will open a blank dialog.
What's Next From your README.html file - some of this is redundant if you have already ran pb_tool deploy
Answered by Cary H on March 12, 2021
I have a video that covers the v3x plugin deployment process.
https://www.youtube.com/watch?v=NqkP_fCH098
Once you get the plugin created and complied you can add a hello world print statement after the .show() method in the mainPlugin.py file. The normal print statement will not show since the plugin is not directly interacting with the python console so I'd recommend you write to the PyQt5 QMessageBox() method.
Answered by artwork21 on March 12, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP