This is a follow-up question to an answer to Deleting Shapefiles using QGIS?
I tried to run the script, however it always returns False and the shapefile is not deleted - any ideas what needs to be changed in order to make it work?
This is what it looks like:
layer = iface.activeLayer()
layer
<qgis._core.QgsVectorLayer object at 0x0000000012DFC1E0>
shp_path = layer.dataProvider().dataSourceUri().split('|')[0]
shp_path
u'C:/GIS/GIS_Kirchenkreise/13 GIS/Grundlagen/Daten_aufbereitet/Wahlkreise_Test.shp'
print (QgsVectorFileWriter.deleteShapeFile(shp_path))
False
prj, theqpjand theshxfiles are deleted, however thedbfand theshpfiles remain. I guess that at least something is happening – Stephanie Nov 04 '16 at 09:33.prj,.qpjand.shxare deleted but.shpand.dbfremain. I'm usingQGIS 3.10.2– GeoGyro Apr 07 '20 at 12:52