Home > Backend Development > Python Tutorial > How to run (run) code on python

How to run (run) code on python

little bottle
Release: 2020-09-18 14:05:21
Original
39817 people have browsed it

A friend has just learned Python. After opening Python and typing the statement to print hello world, he doesn’t know what to do. How can he run the Python code? Below I will introduce several methods to you.

How to run (run) code on python

Next, we will introduce several ways to run python code:

1. Run under the CMD command line:

We run the "Start" menu on WINDWOS - enter "CMD" in the run window and press Enter to enter the CMD command line.

Enter "Python" to enter the Python editing state. After editing the code, press the enter key to run the code.

2. Use any text editor:

Write the code according to the Python syntax format, save it as a file (ending with .py) .

Then use python "file name" in the command window and press enter to start running.

3. In IDLE (python GUI):

Click new file in File and type in the corresponding code. Click "run module" in Run or press the F5 key to run the program.

4. Use Pycharm:

When the code has been coded, click the small arrow at the top to run the code.

How to run (run) code on python

Related learning recommendations: python tutorial

The above is the detailed content of How to run (run) code on python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template