2016-09-22 08:03:38 +01:00
|
|
|
# python
|
2015-11-22 22:27:42 +02:00
|
|
|
|
2016-01-12 21:14:57 +02:00
|
|
|
> Python language interpreter.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://www.python.org>.
|
2015-11-22 22:27:42 +02:00
|
|
|
|
2021-09-12 16:03:27 +02:00
|
|
|
- Start a REPL (interactive shell):
|
2015-11-22 22:27:42 +02:00
|
|
|
|
|
|
|
`python`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Execute script in a given Python file:
|
2015-11-22 22:27:42 +02:00
|
|
|
|
|
|
|
`python {{script.py}}`
|
|
|
|
|
2018-10-17 07:20:12 -06:00
|
|
|
- Execute script as part of an interactive shell:
|
2015-11-22 22:27:42 +02:00
|
|
|
|
2018-10-17 07:20:12 -06:00
|
|
|
`python -i {{script.py}}`
|
|
|
|
|
|
|
|
- Execute a Python expression:
|
|
|
|
|
|
|
|
`python -c "{{expression}}"`
|
2015-12-09 20:30:14 +01:00
|
|
|
|
2021-10-16 20:22:04 +02:00
|
|
|
- Run the script of the specified library module:
|
2015-12-09 20:30:14 +01:00
|
|
|
|
2015-12-09 21:28:39 +01:00
|
|
|
`python -m {{module}} {{arguments}}`
|
2018-10-17 07:20:12 -06:00
|
|
|
|
2021-10-16 20:22:04 +02:00
|
|
|
- Install a package using `pip`:
|
2020-11-27 01:02:20 +00:00
|
|
|
|
|
|
|
`python -m pip install {{package_name}}`
|
|
|
|
|
2018-10-17 07:20:12 -06:00
|
|
|
- Interactively debug a Python script:
|
|
|
|
|
|
|
|
`python -m pdb {{script.py}}`
|