Home  >  Article  >  Backend Development  >  How to run the python program and get the result

How to run the python program and get the result

藏色散人
藏色散人Original
2019-10-24 10:55:455230browse

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

How to run the python program and get the result

Recommendation: "python tutorial"

We can write and run directly here

How to run the python program and get the result

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

How to run the python program and get the result

Then, we open the interpreter and open the py we just wrote through file->open

How to run the python program and get the result

After opening, the following box will be displayed, which is the code we just wrote

How to run the python program and get the result

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

How to run the python program and get the result

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn