I have a working Python console script and have created a plugin (processing provider through the plugin builder). Now I want to put the python console script into the plugin. Can I simply copy and paste the script? Which file do I need to edit and where?
1 Answer
Here is a link that will teach you all you will need to know to create your first QGIS plugin.
You can copy/paste what you wrote in the QGIS python console to the python file called "name_of_your_plugin".py in your plugin folder but you will need to link your functions to a pushbutton (use Qtdesigner for this) for instance to make it work.
-
I have already created the QGIS plugin. I need help on how to add my script (previously made in the QGIS python console) to the plugin.– GISJessCommented Aug 22, 2022 at 14:52
-
-
@Vince, while this is generally true for links pointing to information, I think that in the case of a step-by-step tutorial, the beneficial content is indeed the link and summarizing it in the answer text is unlikely to be helpful unless it would essentially be duplicated.– HouskaCommented Aug 23, 2022 at 10:00
-
And when that link goes stale, since they all do, eventually, then the link-only Answer is devoid of useful information. You don't need to duplicate the information to provide enough detail that the link contents can be found again. It could be enough to include the name of the page in the documentation to be the link text instead of just "link".– VinceCommented Aug 23, 2022 at 11:14