Using python I would like to iterate through a point layer and select from a line layer each line that touches a particular point. To try and familiarize myself with selecting items with python I'm just trying to write a script that selects lines that touch the selected point. This is what I have but I only get "AttributeError: 'list' object has no attribute 'selectedFeatures'".
layer_select = QgsProject.instance().mapLayersByName('Points')
layer_to_select = QgsProject.instance().mapLayersByName('Lines')
for selected_feat in layer_select.selectedFeatures():
to_select = []
for feat_to_select in layer_to_select.getFeatures():
if feat_to_select.geometry().intersects(selected_feat.geometry()):
to_select.append(feat_to_select.id())
layer_to_select.setSelectedFeatures(to_select)