Starting learning Python, speaking of Python, I first came into contact with it is to write a small program on Symbian S60V2 with my mobile phone. At that time, I edited Python code on Nokia N72 mobile phone and wrote a simple tool bbs.dospy.com/thread-1093… It has been more than 5 years, and I am feeling a lot. Now I have forgotten the Python syntax, and now I want to pick it up again. Of course, I didn’t learn it very well in the past, and I plan to use Python to write web back-end and auxiliary scripts, or develop raspberry PI programs with Python.

\

I. Download and install the installation package

\

1. Download

\

No difficulty, download the installation package from the link to download the installation package, www.python.org/downloads/ click the link in the top TAB Windows, download the corresponding installation package, pay attention to distinguish between 32-bit and 64 – bit.

\

We choose the installation version of EXE. It is slow to download it directly from Python Org using a browser. In this case, you can paste the corresponding download link into the download tool such as Thunderbolt to download it, which will be much faster. I use a win 10 64 – bit version, the download address for www.python.org/ftp/python/… . Windows x86-64 Executable Installer

\

2. Install

\

Of course, you can always click next to install to DISK C, but I prefer to install to their own planned disk, such as THE author of disk D installation software.

\

Custom installation process:

\

(1) Select Add Python 3.5 to Path at the bottom and click Customize Installation;

\

(2) In this step, click Next directly. By default, we need to check all these boxes.

\

(3) Select Install for all users and then customize the installation path, such as D:\Python\Python35

\

During installation…

\

(4) The installation is complete.

\

(5) Verify that the Python environment has been deployed on the native machine. Enter CMD and type Python to verify that the installation was successful. If you see the following figure, the installation is successful.

\

3. Possible problems

\

If the CMD does not appear in the end, there may be a problem with setting the environment variable. Check to see if the environment variable has a Python path configured. Here are the environment variables that the author configured properly (the installer automatically configured them).

\

(1) Window view

\

(2) Command line view

\

\

Run Hello World

\

Create a new file named pytest.py, open it and write two lines of printed code:

\

print (“Hello World”)

Print (” Hello world “)

\

Run to view the output, directly run F5. Output is normal on Shell, and Chinese is normal.

\

\

Use Eclipse to develop Python programs

\

Of course, you can also use VS to develop Python, because I am a Java Coder, used to using Eclipse development. Eclipse supports Python development by installing the PyDev plug-in.

\

1. Download the PyDev

\

Go to www.pydev.org/ and click Download to view the Eclipse version and the PyDev and Java versions you need to install. Currently, the latest version of PyDev requires Eclipse 4.6 or higher and Java 1.8. Here is the PyDev version of the older version of Eclipse.

\

Click on www.pydev.org/update_site… To view all versions of PyDev.

\

\

2. Install the PyDev plug-in

\

(1) Direct installation

\

In Eclipse’s help– Install new Software, click ADD and type PyDev, link address: www.pydev.org/update_site… (Enter your own version address), then select PyDev, and the other option is optional. After the installation is complete, restart Eclipse to take effect.

\

\

\

\

The author here is stuck, this way of installation does not work.

\

(2) Manually add plug-ins to Eclipse

\

Since installing Eclipse plug-ins directly may be affected by the network, you can download the compressed package first and manually add plug-ins to Eclipse. To sourceforge.net/projects/py… Download the installation package of the plug-in. After decompressing, the Plugins and Feature folders were obtained, and the contents in these two folders were copied to the corresponding Plugins and Feature directories under the eclipse installation directory respectively. Restart!

\

3.Eclipse configure the python.exe path

\

After opening Eclipse, click Window–Preference–PyDev–Interpreters –Python Interprete– Click New and navigate to the python. exe installation path.

\

As shown below, the configuration is successful.

\

\

Eclipse write a Hello World

\

(1) File–New–Other… – the PydEV – PyProject, Next;

\

Enter Project name, select Grammar Version(3.0–3.5), and select Interpreter, Finish;

\

(3)PyTest project right-click, New–PyDev Module, Package type SRC, Name type your Name, such as test;

\

(4) Open the test.py file and write two lines of code:

\

print (“Hello World”)

Print (” Hello world “)

\

\

\

(5) Right-click Run As–Python Run and print the output on the Console.

\

\

\

References:

Blog.csdn.net/yanzi122562…