Eclipse + pydev configure the python Development Environment

Source: Internet
Author: User

I'm used to using pythonxy in Windows. The Spyder is really comfortable, so how can I see Python IDE in Ubuntu. I suddenly remembered that there was eclipse in pythonxy, so I was going to download one In ubuntu.

Apt-Get can install eclipse, but I haven't completed the pydev plug-in well after a long time. It should be added to/usr/lib/eclipse or/usr/share/eclipse, and the permission must be changed. I flushed it once and then it was gone. The cause is unknown.

Go to http://www.eclipse.org/downloads/next classicloud, which can be used after being decompressed. Then go to the terminal (if you are at/home/user, you don't need to change it ). Then restart eclipse to select the python environment. If not, use./eclipse
-Try clean.

Looking at the code of the pure white background, the eyes were uncomfortable for a long time, so I searched the internet and found a way to change the color.

1. Change the eclipse background color

Windows-> peferences-> General-> editors-> text editorappearance color options: select background color, remove system default, and select the color (color: 85) in the color. Saturation: 123. Brightness: 205), and then apply
 
 
2. Change the comment color of pydev.
After the pydev plug-in is installed, the color of the comment is gray by default. It is very laborious to see the comment, so I found another way to change the comment color.
Windows-> peferences-> pydev-> editorappearance color options: Select comments, select color in color, and then apply
3. display the row number:
Window -- Prefences -- General -- Editors -- Text Editors -- show line numbers

4. Open the python interpreter in pydev:

In pydev, you sometimes want to use the direct write and debug method. It is easier to use the python interpreter. In pydev, open the method:
Now the code is much more effort-saving.


5. Adding existing files is still troublesome for eclipse to add existing files. In addition to dragging the files into 'explorer ', I did not find a reference to the external files directly. However, if you can copy the source file without generating any bugs, copy the file and press F5, and the file will appear in 'explorer '.
-------------------------------------------

There are many Python editors. For details, see http://wiki.python.org/moin/pythoneditors. The official idle, pythonwin, and eclipse (pydev) are recommended. Idle can be obtained after the official Python software package is installed, and pythonwin can be obtained by installing activepython. Pydev is a plug-in used to expand eclipse. After installation, you can use eclipse to develop python.

1. You can find and download eclipseeclipse on eclipse.org. Generally, you can select an eclipse version suitable for you, such as Eclipse classic. After the download is complete, decompress the package to the directory you want to install. Of course, before executing eclipse, you must confirm that the Java Runtime Environment is installed, that is, you must install JRE or JDK, you can find the JRE download and install in (http://www.java.com/en/download/manual.jsp.

2. After installing pydev to run eclipse, select help --> install new software, as shown in.

Click Add to add the installation address of pydev: http://pydev.org/updates/, as shown in.

Click "OK", and then click "+" of pydev to expand the pydev node. Wait a short time for it to obtain the relevant pydev kit from the Internet, after completion, the pydev related suites will be added to the sub-nodes. Select them and click Next to install them. As shown in.

After installation, restart eclipse.

3. After installing pydev, set pydev and select Window> preferences to set pydev. Set the python path and select new from the interpreter-Python page of pydev.

A window will pop up asking you to select the python installation location and select the location where you install python.

After completing the settings, you can start using pydev.

4. Create a python project: After eclipse + pydev is installed, we can start to use it for project development. First, create a project and select File> New> pydev project.

A new window will pop up, fill in the project name and Project SAVE address, and then click Next to complete the project creation.

5. If you create a new pydev module, a project cannot be executed. Then, you must create a new pydev Moudle and select File> New> pydev module.

In the pop-up window, select the file storage location and Moudle name. Note that the name does not need to be added with. py, And it will automatically help us add. Click Finish to complete the creation.

Enter the "Hello World" code.

6. After the execution program is completed, we can start to execute the program and find the execution button on the toolbar above.

A window will pop up asking you to select the execution method. Generally, we select Python run to start executing the program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.