I can open the console programmatically, using:
qgis.utils.iface.actionShowPythonDialog().trigger()
Is there a way to additionally open the console's editor (the window where you can enter multiple lines of code)?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI can open the console programmatically, using:
qgis.utils.iface.actionShowPythonDialog().trigger()
Is there a way to additionally open the console's editor (the window where you can enter multiple lines of code)?
You need find the widget and after the QAction,It doesn't have a direct method in PyQGIS
consoleWidget = iface.mainWindow().findChild( QDockWidget, 'PythonConsole' )
consoleWidget.console.showEditorButton.trigger()
To find the name of the objects look at the source code
Or, this other way , based on this answer https://gis.stackexchange.com/a/358580/49538
from console import console
console._console.console.showEditorButton.trigger()