1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 21:22:08 +02:00
tldr/pages/common/python.md
2021-10-31 02:07:39 -03:00

36 lines
678 B
Markdown

# python
> Python language interpreter.
> More information: <https://www.python.org>.
- Start a REPL (interactive shell):
`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 the script of the specified library module:
`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}}`
- Start the built-in HTTP server on port 8000 in the current directory:
`python -m {{http.server}}`