I'm trying to write a "simple" plugin as training and to automate a task repetitive task as well. I would like to have the map layer hardcoded instead of make sure you select the correct one but if I use mapLayersByName it adds [ and ] to start and end of layer which makes it think its a list. I can fix this by using Layer[0].getFeatures() instead of normally using Layer.getFeatures()
What causes this?
Layer = QgsProject.instance().mapLayersByName('Parry Sound FDSA Boundaries')
layer = iface.activeLayer()
print(Layer)
[<qgis._core.QgsVectorLayer object at 0x000001D610F0AD38>]
print(layer)
<qgis._core.QgsVectorLayer object at 0x000001D610F0AD38>