PyQGIS: Adding and deleting vector layer fields
Objectives: Add fields to a shapefile Delete fields from a shapefile Open the QGIS Python Console From the menu, select Plugins -> Python Console, or Ctrl + Alt + P (Windows) You can type directly into the console, or select the pad and paper icon to write code in the editor. I prefer to write…