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 Windows

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 installer 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.


v2-4e11363cc96ed5e2508b637a82141f87_720w.png


Use the IDLE integrated development environment provided by Python itself

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.


v2-7d6c873e1965902028d757f91622136a_720w.jpeg


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 are new to a new programming language, it is important to first run the program. At least you can have a good understanding of the language.

To run python scripts, there are several ways 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 about opening methods in different python systems is introduced. For more related python opening methods, please search for previous articles or continue to browse related articles below. Hope you will support you in the future!


Guess you like

Origin blog.51cto.com/14825302/2542828