Build a Python development environment in Eclipse, eclipsepython
Build a Python development environment in Eclipse
Contents
1. Background
2. Python Installation
3. Install the plug-in PyDev
4. Test Demo
I. background
Eclipse is a Java-based scalable development platform. Its official downloads include J2EE, Java, C/C ++, and mobile application versions. In addition, Eclipse can also develop languages such as Python, Android, and PHP by installing plug-ins.
Eclipse + PyDev plug-in is the most popular Python development environment. This article will introduce the use of Eclipse and PyDev plug-ins.
Ii. Python Installation
Python installation involves three steps: Downloading python, configuring environment variables, and testing the installation.
(1) download python: It is difficult to download python on a foreign server when the network speed is poor. You can directly search for Python installation in Baidu. There is a python installation package of the latest version provided by Baidu software. Download and select the installation directory and click next.
(2) Configure environment variables: I personally feel that creating environment variables in Win8 is very good.
(3) the installation is successful. Command: python-V (V is an uppercase V)
Iii. Install the plug-in PyDev
The plugin PyDev can be installed online or offline. (The premise is that the local machine has installed Eclipse correctly)
(1) install the SDK online at: http://pydev.sourceforge.net/updates. Select PyDev for Eclipse to Finish installation. Restart Eclipse and point to the Python installed on the local machine in Window> preference> PyDev> Interpreter> Python Interpreter (translator.
(2) offline Installation
Iv. Test Demo
You can use a simple crawler instance to check whether the environment is OK.
1/** 2*1. Create a PyDev project 3*2. Select Grammar Version and Interpreter 4*3. Create a package named zhiye in the project Demo, will automatically generate containing _ init _. py directory structure 5*4. On the zhiye package, create a PyDev module named test_demo, the test_demo.py file 6 is automatically generated. The local Python version 3.4 8 **/9 # coding: utf810 11 import urllib. request12 13 url = "http://www.cnblogs.com/runforlove" 14 request = urllib. request. request (url) 15 response = urllib. request. urlopen (request) 16 print (response. code) 17 print (response. read (). decode ("utf8 "))Python Demo
The test is successful Based on the code.