Hi devs,

for a long time I used that code to get the __file__ when running

my scripts from the QGis python console. Is there a better way ?

Thxs,

import osfrom console.console import _console

script_path = _console.console.tabEditorWidget.currentWidget().path
print(os.path.dirname(script_path))
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to