Skip to main content

Python language interpreter commands.

# To call a Python interactive shell (REPL):

# To execute script in a given Python file:
python <>

# To execute script as part of an interactive shell:
python -i <>

# To execute a Python expression:
python -c "<expression>"

# To run library module as a script (terminates option list):
python -m <module> <arguments>

# To install a package using pip:
python -m pip install <package_name>

# To interactively debug a Python script:
python -m pdb <>