Home >Backend Development >Python Tutorial >How to run the python program and get the result
How does the python program run?
Use the python interpreter
Installing python will generally have an interactive interpreter
Recommendation: "python tutorial"
We can write and run directly here
But if we close it, just now The code you wrote will be lost. At this point, we create a new text document, write print 'hello world', and then rewrite the file name as: hello.py. Note that the suffix is py. Your computer must display the suffix before you can see it
Then, we open the interpreter and open the py we just wrote through file->open
After opening, the following box will be displayed, which is the code we just wrote
At this time, you can click Run- >run module, or press F5 directly to run the code, as shown in the figure below, the operation is successful and the result is printed
The above is the detailed content of How to run the python program and get the result. For more information, please follow other related articles on the PHP Chinese website!