2016-09-22 08:03:38 +01:00
|
|
|
# python
|
2015-11-22 20:27:42 +00:00
|
|
|
|
2016-01-12 19:14:57 +00:00
|
|
|
> Python language interpreter.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://www.python.org>.
|
2015-11-22 20:27:42 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Call a Python interactive shell (REPL):
|
2015-11-22 20:27:42 +00:00
|
|
|
|
|
|
|
`python`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Execute script in a given Python file:
|
2015-11-22 20:27:42 +00:00
|
|
|
|
|
|
|
`python {{script.py}}`
|
|
|
|
|
2018-10-17 14:20:12 +01:00
|
|
|
- Execute script as part of an interactive shell:
|
2015-11-22 20:27:42 +00:00
|
|
|
|
2018-10-17 14:20:12 +01:00
|
|
|
`python -i {{script.py}}`
|
|
|
|
|
|
|
|
- Execute a Python expression:
|
|
|
|
|
|
|
|
`python -c "{{expression}}"`
|
2015-12-09 19:30:14 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run library module as a script (terminates option list):
|
2015-12-09 19:30:14 +00:00
|
|
|
|
2015-12-09 20:28:39 +00:00
|
|
|
`python -m {{module}} {{arguments}}`
|
2018-10-17 14:20:12 +01:00
|
|
|
|
|
|
|
- Interactively debug a Python script:
|
|
|
|
|
|
|
|
`python -m pdb {{script.py}}`
|