Hot answers tagged

2

Try using os.walk: import os root_folder = r'/home/bera/Downloads' #Change to match your main folder for root,folders,files in os.walk(root_folder): for file in files: if file.endswith('.kml'): vl = QgsVectorLayer(os.path.join(root,file), os.path.splitext(file)[0]) #Create vector layer QgsProject.instance().addMapLayer(vl)...


Only top voted, non community-wiki answers of a minimum length are eligible