Home > Backend Development > Python Tutorial > How to start Python

How to start Python

anonymity
Release: 2019-05-27 14:27:55
Original
10012 people have browsed it

The first problem that many novice friends encounter is not the data structure of Python, the use of Python class libraries, nor the application of third-party modules and frameworks, but simply "how to run"!

How to start Python

#Python can be run in the following two ways, for example on the Windows platform, but the same is true for the Linux platform.

1. Use IDLE that comes with Python

Find IDLE (Python GUI) in Start-->Program-->Python2.5 (depending on the version you installed) ,

After clicking, the following form will pop up:

How to start Python

Enter the code after the >>> prompt and press Enter to execute this code .

IDLE supports syntax highlighting, automatic indentation, and method prompts, but the prompts are very slow.

2. Run on the command line window
The premise of this method is that you configure the Python installation path in the system's PATH variable.
Right-click My Computer-->Properties-->Advanced-->Environment Variables, find the Path item in the system variable list, click the edit button, and add "C:\Python25;" (path and The version depends on your installation), save and exit.
Start-->Run-->Enter cmd and press Enter to open a CMD window.
After the DOS prompt>, enter python and press Enter to enter the Python environment.
Its operation is basically the same as IDLE, but there is no syntax highlighting, automatic indentation, and method prompts. The only advantage is that it runs faster than IDLE (if you tell me that I can add parameters to run python, then you I’m not a newbie anymore, so I don’t need to read this article), so it’s not very useful.
Exit this python environment using Ctrl Z and press Enter.

The above is the detailed content of How to start 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template