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

How to run (run) code on python

little bottle
little bottleOriginal
2019-05-21 11:22:5439735browse

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!

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
Previous article:Is python useful?Next article:Is python useful?