Skip to content
Browse files
Import all qgis.gui, analysis, processing, and Qt classes by default
in Python console

Because it's a PITA to remember to manually import these all the time
  • Loading branch information
nyalldawson committed Aug 6, 2017
1 parent 6f7ef8a commit 069fadfc5333547541e1d9386a1a1dd484951190
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/console/
@@ -36,8 +36,8 @@
from qgis.core import QgsApplication, QgsSettings
from .ui_console_history_dlg import Ui_HistoryDialogPythonConsole

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
_init_commands = ["from qgis.core import *", "from qgis.gui import *", "from qgis.analysis import *", "import processing", "import qgis.utils",
"from qgis.utils import iface", "from qgis.PyQt.QtCore import *", "from qgis.PyQt.QtGui import *", "from qgis.PyQt.QtWidgets import *"]
_historyFile = os.path.join(QgsApplication.qgisSettingsDirPath(), "console_history.txt")

0 comments on commit 069fadf

Please sign in to comment.