How to open python in different systems

In the command line window or Shell window of Linux, Windows, and Mac OS, execute the python command to start the Python interactive interpreter. The interactive interpreter will wait for the user to enter Python statements. Enter a Python statement and press Enter, the interpreter will execute the statement and output the result. The interactive interpreter is a better tool for learning Python language. The advantage is that you can get immediate feedback when you enter Python sentences.

Start the interactive interpreter in the Windows environment

There are two ways to start the Python interactive interpreter on Windows. The first way is to enter the Pyhton installation directory and run the python.exe program directly; the second way is to enter the Windows command line window and start python.exe in the command line window.

To start the Python interactive interpreter in the Windows command line window, you first need to add the path of the Python installation directory to the Path system environment variable. Otherwise, you can only enter the Python installation directory to start the interactive interpreter. When installing Python3.7, if the [Add Python3.7 to PATH] option is checked, the installation program will automatically add the Python installation directory to the Path system environment variable.

Enter the Windows command line window, enter the python command to start the interactive interpreter, enter the python statement and execute it, as shown in the figure below.

Use the IDLE integrated development environment provided by Python

Pyhton itself provides a simple integrated development environment with basic IDE functions. Use IDLE to create, run, test and debug Python programs more conveniently.

Windows and Mac OS launch IDLE

There are many ways to start IDLE in Winodws environment, you can start IDLE through shortcut menu, desktop icon, enter Python installation directory and run IDLE directly.

Mac OS starts IDLE in the same way as the interactive interpreter. It can be started directly in the Python installation directory, or it can be started by entering the open /usr/bin/idle command in a terminal window.

Simple use of IDLE

IDLE itself is a Python shell, you can directly input and execute Python statements in the IDLE window, IDLE automatically typeset and highlight the keywords. As shown below.

IDLE can also save, open and execute code files.

Content expansion:

The call of the module in python will be posted later on the basis of the modification in the original reprinted literature.

For friends who have just come into contact with a new programming language, it is important to run the program first. At least you can have a good understanding of the language.

To run a python script, there are several aspects to achieve:

Run directly on the command line:

There are different operating system platforms, mainly windows, linux, unix and other systems.

For windows: In the DOS window, enter python to enter the python running window, and then write code in it.

So far, this article on the opening methods in different python systems is introduced. For more related python opening methods, please search for the previous articles of ZaLou.Cn or continue to browse the related articles below. Hope you will support ZaLou.Cn more in the future. !

Recommended Posts

How to open python in different systems
How to wrap in python code
How to write classes in python
How to filter numbers in python
How to read Excel in Python
How to view errors in python
How to write return in python
How to understand variables in Python
How to clear variables in python
How to use SQLite in Python
How to use and and or in Python
How to delete cache files in python
How to introduce third-party modules in Python
How to save text files in python
How to write win programs in python
How to run id function in python
How to install third-party modules in Python
How to custom catch errors in python
How to write try statement in python
How to define private attributes in Python
How to add custom modules in Python
How to understand global variables in Python
How to open root account in Ubuntu20.04
How to sort a dictionary in python
How to add background music in python
How to represent relative path in python
How to use the round function in python
How to use the zip function in Python
How to program based on interfaces in Python
How to install python in ubuntu server environment
How to simulate gravity in a Python game
How to use the format function in python
How to open the ubuntu system in win10
How to use code running assistant in python
How to set code auto prompt in python
Teach you how to write games in python
How to delete files and directories in python
How to install the downloaded module in python
How to perform continuous multiplication calculation in python
How to comment python code
How to uninstall python plugin
How to understand the introduction of packages in Python
How to understand a list of numbers in python
Example of how to automatically download pictures in python
How to save IE as an attachment in python
How to use python tuples
How to create a Python virtual environment in Ubuntu 14.04
What are the ways to open files in python
Do you still know how to draw cakes in python? ? ?
How to install Helm in Ubuntu
python how to view webpage code
How to use hanlp in ubuntu
How to use python thread pool
How to write python configuration file
How to install PHP7.4 in CentOS
How to save the python program
How to install mysql in Ubuntu 14.04
How to install Python 3.8 on Ubuntu 18.04
How to install Python on CentOS 8
How to install HDP2.6 in Centos7.2
How to solve python dict garbled