There are three ways to execute a python program:
1. Interpreter
For example, enter: python on the command line D:/Code/Python/Hello.py
Python's interpreter: Cpython, pypy, etc.
2. Interactive
The so-called interactive means to run the interpreter directly in the terminal command without entering the file name to be executed.
Method 1. Enter ipython or ipython3 on the command line to enter the interactive shell environment. If you cannot enter, you need to install ipython and python mirroring.
Configuration method:
pip3 install ipython -i https://pypi.tuna.tsinghua.edu.cn/simple
ctrl D or exit to exit ipython.
Method 2: Enter python (official shell) in the command line window
You can directly enter the python program code here, and use exit() or ctrl D to exit.
3. Integrated development environment
such as PyCharm.
Recommended tutorial: python tutorial
The above is the detailed content of What are the ways to execute python source programs?. For more information, please follow other related articles on the PHP Chinese website!