Project:
QGIS
Version:
3.32
Feature: Run shell commands from the Python Console
The QGIS Python ConsoleMimics IPython behavior to run system commands.
- Run any command that works at the command-line with the syntax
!<cmd>
. The console will start a subprocess, and forward its output to the Python Console Output.
- While the subprocess is running, the Python Console Input switch to STDIN mode and forwards entered character to the child process. This make it possible to send confirmation when the child program ask for it.
- This provides easy access to commands such as pip for the simple installation and removal of dependencies directly within the QGIS project context
- When the Console is in STDIN mode, pressing Ctrl+C will kill the subprocess.
- Affect the result of a command to a variable with the syntax
var = !cmd