79828399

Date: 2025-11-24 08:25:00
Score: 2
Natty:
Report link

I have used what @lejedi76 proposed, but the code does not work in the recent versions of QGIS.

In my Windows 10 & QGIS 3.40.11, this worked:

import console
script_path = iface.mainWindow().findChild(console.console.PythonConsole).findChild(console.console_editor.EditorTabWidget).currentWidget().file_path()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @lejedi76
  • Low reputation (1):
Posted by: Hiro Ishise