Home > Article > Backend Development > How to run python program
Through the previous study, we now have mastered the basic knowledge of Python, and we can also write some simple codes ourselves. So how do you run the code you wrote?
Today we’ll talk about how to use Python’s built-in idle to run our code
The use of IDLE has been discussed in previous tutorials and will not be repeated here. Repeat. Go straight to the topic
IDLE Create a new Python file. After opening IDLE, click File in the upper left corner, and then click the first item NewFile to create a python file. Or directly use the shortcut key, Ctrl N, to create quickly.
Write Python code in the created file
Save the file, Directly use the shortcut key, Ctrl S, The format of the file name must end with .py
Run the saved Python file (program) directly Run Python programs in IDLE. Click Run at the top of the window, then click RunModule to run the program. You can also use the shortcut key F5 to run quickly.
Let’s practice it!
The above is the detailed content of How to run python program. For more information, please follow other related articles on the PHP Chinese website!