mirror of https://github.com/CrimsonTome/tldr.git
33 lines
589 B
Markdown
33 lines
589 B
Markdown
# python
|
|
|
|
> Python language interpreter.
|
|
> More information: <https://www.python.org>.
|
|
|
|
- Call a Python interactive shell (REPL):
|
|
|
|
`python`
|
|
|
|
- Execute script in a given Python file:
|
|
|
|
`python {{script.py}}`
|
|
|
|
- Execute script as part of an interactive shell:
|
|
|
|
`python -i {{script.py}}`
|
|
|
|
- Execute a Python expression:
|
|
|
|
`python -c "{{expression}}"`
|
|
|
|
- Run library module as a script (terminates option list):
|
|
|
|
`python -m {{module}} {{arguments}}`
|
|
|
|
- Install a package using pip:
|
|
|
|
`python -m pip install {{package_name}}`
|
|
|
|
- Interactively debug a Python script:
|
|
|
|
`python -m pdb {{script.py}}`
|