I'm writing a script on PyQGIS, but when I start it, this always crashes and I don't understand the reason. After a lot of attempts, I undersand the problems are the following rows of code:
QgsProject.instance().addMapLayers([aRispettoLayer])
QgsProject.instance().addMapLayers([edF])
QgsProject.instance().addMapLayers([terrF])
Are there alternative instructions that do the same task? Is there someone with the same problem?