Home >Backend Development >Python Tutorial >Python automated testing Eclipse+Pydev builds development environment

Python automated testing Eclipse+Pydev builds development environment

高洛峰
高洛峰Original
2017-02-25 13:07:441553browse

Python automated testing Eclipse+Pydev to build a development environment

The reason why C# is easy to interest is because after installing Visual Studio, you can easily write directly The program is ready, no configuration is required. For novices, this is a very good "first experience" and will stimulate their confidence and interest.

The configuration of the development environment of some languages ​​is very troublesome, which makes novices feel frustrated. Without a good "first experience", they may be in awe of the language and lose interest.

As a .NET programmer, I am used to Visual Studio. The powerful functions of Visual Studio, such as smart prompts, auto-complete, etc., can greatly reduce our memory and workload. If there were no smart prompts, it would be crazy. Now that I'm older, I can't remember those function names at all, so I have to rely on the IDE's smart prompts.

The first and most important thing to do when learning Python is to choose an IDE, preferably one with functions like Visual Studio.

This article focuses on why you use the Eclipse+pydev plug-in to write Python code, as well as configuring Eclipse+Pydev on Mac and configuring Eclipse+Pydev on Windows

Reading directory

  1. A good IDE at least has these functions

  2. Editor: Python’s own IDLE

  3. Editor: VI

  4. Editor: Eclipse + pydev plug-in

  5. Install Python

  6. Install JAVA JDK

  7. Download Eclipse

  8. pydev plug-in introduction

  9. Install the pydev plug-in in Eclipse

  10. Configure the pydev interpreter

  11. Start writing a code

A good IDE has at least these functions

1. Intelligent prompt, (there is no need to remember the function name, it is already a class library, and it can be called through intelligent prompt, and the function name will not be mistaken.)

2 . Breakpoint debugging (In the process of writing a program, you must be able to set breakpoints, view variables, and execute step by step. This makes it easier to read the code written by others)

3. Auto-complete function (can speed up writing Code speed)

4. Syntax error prompts, (the scripting language is executed step by step, and syntax errors will not be detected until execution. If the IDE can detect syntax errors that occur during the compilation process in time)

5. Easy to read code, (from one file to another, support reading back, view definitions etc.)

Editor: Python’s own IDLE

Simple and fast, when learning Python or writing small software. very useful.

Editor: VI

must be mastered, the universal editor. You can develop many programs, including Ruby and Python. Supports Windows and Mac. 80% of my colleagues use this to write code. Looking at their screens, the screen is full of code, which makes them feel like programmers.

I don’t know why, I’m not very used to it. Maybe it's because I'm used to graphical interfaces like Visual Studio.

But you still need to know the basic operation of this. For example, when you want to edit a file, you can use VI to edit it. Convenient. I am not very used to using VI for large-scale development.

Editor: Eclipse + pydev plug-in

1. Eclipse is an IDE for writing JAVA, so you can It is universal and the learning cost is small. After learning Eclipse, you can write Python or JAVA in the future.

2. Eclipse, powerful.

3. Eclipse is cross-platform and can run on Mac and Windows

Install Python

Download address: http://www.php. cn/

Python has two versions: Python 2 and Python 3. There are some differences in syntax. To be on the safe side, I installed Python 2.7.5

Install JAVA JDK

Download address: //m.sbmmt.com/

Eclipse You need to install JAVA JDK before you can run it

Download Eclipse

//m.sbmmt.com/ Download here.

After downloading, unzip and use it directly. Eclipse does not need to be installed.

pydev plug-in introduction

The official website of the pydev plug-in: //m.sbmmt.com/

Installation in Eclipse pydev plug-in

Start Eclipse, click Help->Install New Software... In the pop-up dialog box, click the Add button. Fill in Name: Pydev, Fill in Location //m.sbmmt.com/

and then install it step by step. If an error is reported during the installation process. Just reinstall.

Python自动化测试Eclipse+Pydev 搭建开发环境

Python自动化测试Eclipse+Pydev 搭建开发环境

Configure the pydev interpreter

After installing pydev, you need to configure the Python interpreter .

In the Eclipse menu bar, click Windows ->Preferences.

In the dialog box, click pyDev->Interpreter - Python. Click the New button, select the path of python.exe, and it will be displayed after opening A window containing many check boxes will appear. Click OK

If it is a Mac system, click the "Auto Config" button

Python自动化测试Eclipse+Pydev 搭建开发环境

Start writing code

Start Eclipse, create a new project, File->New->Projects... Select PyDev->PyDevProject and enter the project name.

Python自动化测试Eclipse+Pydev 搭建开发环境

New pyDev Package. You can write code.

Python自动化测试Eclipse+Pydev 搭建开发环境

Python自动化测试Eclipse+Pydev 搭建开发环境

The above is the collection of information on building a development environment with Eclipse+Pydev. We will continue to add relevant information in the future. Thank you for your support of this site!

For more articles related to Python automated testing Eclipse+Pydev building a development environment, please pay attention to 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