I'm writing a script in the processing script editor of QGIS and at one point i want to delete all columns of my vector layer's attribute table. I tried to do it like this:
lst = list(range(0,-1))
def deletecolumn():
#Feld(er) löschen
alg_params = {
'COLUMN': lst,
'INPUT': 'C:\\Users\\User\\Schutzgebiete\\FFH-Gebiet\\FFH_20170602\\FFH.shp',
'OUTPUT': Output
}
processing.run('qgis:deletecolumn', alg_params)
Output = 'C:\\Users\\User\\QGIS\\Test.shp'
deletecolumn()
Because i have to do it for several vector layers i wanted to use the range function and first and last index because the number and name of the columns are always different.