Home  >  Article  >  Backend Development  >  How to open python3

How to open python3

anonymity
anonymityOriginal
2019-06-18 11:06:343131browse

The first is to open and run Python. There are three running methods under the Windows system: 1. Use the DOS command line window 2. Use the IDLE that comes with Python 3. Use the script to run.py

How to open python3

1. Use the DOS command line window

First search for Python in the search box, open Python.exe

>>>Enter print("hello world") and press the Enter key to get the following picture //Note that the syntax is different from Python2

2. Use Python’s own IDLE

First search for IDLE in the search box and open it;

Enter print("hello world") after >>> and then press the Enter key

3. Use the script to run .py

This method is used in 99.9% of cases. Using independent scripts to run has the advantages of repeatability and modifiability.

Four Editors: Sublime, Atom, VS Code and Notepad

3.1 Create a new .py file

(1) Open your text editor (Notepad is also acceptable), save it as a *.py file

(2) Also use the IDLE-file-new File opened by the previous method to create a new .py file

3.2 Edit. py file

(1) Right-click to open, use an ordinary text editor or IDE

(2) or directly open it with txt for editing and enter print("hello world")

3.3 Run the script file

(1) Just press F5 when running in the editing state

(2) Just double-click to run in the non-editing state; the result of the small program flashes Then, add input()

at the end. Note: If it cannot run, the system PATH variable may not be configured.

The above is the detailed content of How to open python3. 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