Geographic Information Systems Asked on May 13, 2021
Where is stored path to processing scripts folder in PyQGIS?
Version of QGIS is 3.16.
I want to get this path by Python script.
I suppose then, is stored in processing object:
from qgis import processing
My solution is:
from processing.core.ProcessingConfig import ProcessingConfig
print(ProcessingConfig.getSetting('SCRIPTS_FOLDERS'))
is simple and works at Python Console (opened QGIS project)
Correct answer by Wenceslauw on May 13, 2021
If you have not changed the default path, you can recreate it using the path of your profile using qgisSettingsDirPath method from the QgsApplication class.
user_directory = QgsApplication.qgisSettingsDirPath()
print(user_directory)
# C:/Users/vaclav/AppData/Roaming/QGIS/QGIS3profilesdefault/
processing_directory = os.path.join(user_directory,'processing/scripts')
print(processing_directory)
# C:/Users/vaclav/AppData/Roaming/QGIS/QGIS3profilesdefault/processing/scripts
Answered by Vincent Bré on May 13, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP