Friday, April 17, 2020

6 ways to run python


Python language interpreter

Python interpreter can be used many ways from command line.

Beginners guide: https://wiki.python.org/moin/BeginnersGuide

Developers guide: https://devguide.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
  •  Interactively debug a Python script:
         python -m pdb script.py

     

No comments: