How to Configure Eclipse for Python --- 在eclipse中如何配置pydev
From: http://www.rose-hulman.edu/class/csse/resources/Eclipse/eclipse-python-configuration.htm
Python开发工具: eclipse For pydev
在eclipse中如何配置pydev
How to Configure Eclipse for Python
Rose-Hulman Institute of Technology -
Computer Science & Software Engineering
Python3 must be installed before the complete instillation can be completed. If you don't have Python installed you can install it using these directions
Install the PyDev plug-in for Eclipse
Launch Eclipse
Launch Eclipse. A screen like this should appear, where you can choose which workspace to open. (If not, go to
File → Switch Workspace → Other)- Screenshots read 'Python 3.1', which is the old version. You will be installing Python 3.2.

Browse the csse120 folder which you created when installing Eclipse. Select "Use this as the default and do not ask again".
If you do, Eclipse will automatically use this workspace next time you open Eclipse. If you want to change the workspace later you can always go to File → Switch Workspace... to be sent back to the Workspace Launcher window.
You should now see Eclipse's Welcome screen:

Click on the arrow on the right to go to the workbench.

This is where you'll do most of your work in Eclipse.
Download PyDev from within Eclipse
- Go to Help → Install New Software

Enter http://pydev.org/updates in the Work with: field.
After several seconds, two options should appear. Select the PyDev for Eclipse option. Do not select the "PyDev Mylyn Integration" flag.

- Click "Next" and "OK" to continue installing PyDev.
- Select "I accept the terms of the license agreement", then click "Finish". The installer will begin to download the plug-in.
- Note: When you see the Selection Needed dialog box, you must manually check the box before pressing okay. If you do not, it appears that the installation is continuing, but it is not. You must uninstall PyDev, then reinstall.

- A security warning may appear asking whether you trust the software being installed- click "ok", then ensure the correct items are selected and click yes. The instillation process will continue.
- When the installation is complete, you will be asked if you want to restart Eclipse. Select "Yes". You may see a Subclipse Usage dialog, just uncheck the box and continue.
- Go to Help → Install New Software
Configure PyDev
- Python must be installed to configure PyDev.
Go to Window → Preferences. In the Preferences window, expand PyDev and select Interpreter-Python.

Click "New..." and type Python32 for the Interpreter name. For the Interpreter executable, browse to your copy of Python (C:\Program Files\Python32\python.exe), and press Open.

Click "OK" and the Selection Needed Window will appear.

- Select all but the PySrc and python32.zip and click OK as many times as necessary to exit the preferences. The default selection should be fine.
- The Interpreter is now set up so that the code you write can be interpreted for the computer to run. You are now ready to start running code.
Installing Eclipse Preferences for Python
Download the Eclipse Preferences
Unzip this Preferences for csse120 file, placing its sole unzipped file (EclipsePreference-2011-06.epf) in any convenient location (your desktop, My Documents folder, etc).
Import the Preferences
Launch Eclipse.
If Eclipse offers to Select a Workspace, browse to C:\EclipseWorkspace\csse120.
If the csse 120 workspace does not appear automatically, choose File → Switch Workspace → Other, and click Next.
Now you are ready to set the preferences for the workspace:
Choose File → Import
In the Import dialog box, select General → Preferences and click Next.
When the Import Preferences dialog opens, select Browse and find the EclipsePreferences-2011-06.epf file that you unzipped and saved above.
Back in the Import Preferences dialog, check Import All, then select Finish.
As before, if the Subclipse Usage dialog makes an appearance, uncheck the box and continue.
Confirm that the installation did not leave behind unintended files by checking if there is:
random .eclipse folder anywhere, possibly in the folder immediately above My Documents.
Any extra users (for example, the installer), in C:\Users
Extra Eclipse workspaces anywhere except for the folders inside C:\EclipseWorkspaces.
Writing Your First Python Program
Switch to the Python perspective
Go to Window → Open Perspective → Other and choose PyDev, then click OK. If you look at the upper right corner you will see that the perspective has changed from "Java" to "PyDev".

Perspectives are designed to have the most useful tools within reach for whatever task you are doing (for example writing Java code or writing Python code). If you look in the File→ New menu you will see that there are different options with the different perspective.
PyDev Perspective Java Perspective 

As you can see, perspectives greatly affect the look of the Eclipse program.
Create a new project
- Go to File → New → PyDev Project to start a wizard.
In the next window that appears, enter the name of your project and select "python" and 3.0"; as the type. Make sure "create default 'src' folder and add it to the pythonpath?" is selected. Click Finish.

If you look at the upper left corner of the workspace (in the Package Explorer view), you should now see your newly created project with a "src" folder inside.

Create a new module
Select the project you just created and go to File → New → PyDev Module. This will launch a new PyDev Module Wizard where you should enter a name for your module and make sure it is in the right location. Leave the Package field blank and select Finish.

Look in the Package Explorer view and you will see an icon of your new file inside the src folder, which Eclipse created when you made the new project before.

The file should be opened in the open space in the center of the workspace-the Editor view. (If not, right click on the greeting.py icon and select Open.) You will see a tab with the name of your file.

Write and run the program
Here's a program to greet the world. Simply type
print('Hello, World!')into the file. You may remove the default doc comment or leave it there; Python ignores it.
Right click on the file and select Save (or press Ctrl+S) to save the file.
- Finally, choose the greeting.py icon, and go to Run → Run As → Python Run to run your program.
(A quicker alternative is to right-click on the greeting.py icon, and select Run As → Python Run, or press Ctrl+F11.)

Look at the bottom of your screen at the Console view and you will see the message you told the computer to print.

Congratulations! You have written your first program with Python.
Configure PyDev for Productivity
Add line numbers
- Add line numbers by right-clicking in the margin at the left side of the code view and click on Show Line Numbers.
Change the comment color to one you can read more easily
- Go to Window → Preferences. Open PyDev and select Editors (actually click on 'Editors', don't just expand it). In the Appearance Color Options dropdown menu, select Comments. Then change it to a brighter color (perhaps fuchsia?).

- Go to Window → Preferences. Open PyDev and select Editors (actually click on 'Editors', don't just expand it). In the Appearance Color Options dropdown menu, select Comments. Then change it to a brighter color (perhaps fuchsia?).
Turn on Task view to show TODO: items and add a CONSIDER: tag
- Go to Window → Show View → Tasks.
- Window → Preferences → PyDev → Task Tags, and add CONSIDER: to the end of the list.
- To get the task tags to show, run the program once, or select Project → Clean
How to Configure Eclipse for Python --- 在eclipse中如何配置pydev的更多相关文章
- python 笔记1:安装python;eclipse中安装配置pydev
1 下载安装python. 官网:https://www.python.org/downloads/ 根据自己的操作系统选择需要的版本下载并安装. 我的电脑操作系统windows xp的,只 ...
- python 笔记1:官网下载及安装python;eclipse中安装配置pydev
1 下载安装python. 官网:https://www.python.org/downloads/ 根据自己的操作系统选择需要的版本下载并安装. 我的电脑操作系统windows xp的,只 ...
- 使用eclipse作为python开发工具安装旧版pydev
在Eclipse中: Help->Install New Software add之后输入的链接地址 https://dl.bintray.com/fabioz/pydev/old/ 如果使用从 ...
- python 在sublime 中的配置
首先可以先装package control 方法——按ctrl+`,然后在命令行里复制粘贴以下代码, import urllib2,os;pf='Package Control.sublime-pac ...
- windows下python+Django+eclipse开发环境的配置
1.JDK环境的安装 在http://www.java.com/zh_CN/download/faq/develop.xml 页面下,点击JDK下载,下载所需的jdk版本.直接点击安装即可. 2.py ...
- windows下搭建eclipse关于python的开发环境及初始化参数配置
1.安装jdk 因为eclipse是java开发的,运行eclipse程序需要安装jdk 安装jdk以后需要配置java_home环境变量 2.安装python2.7(比较简单,此处略) 3.下载ec ...
- [No000076]用Eclipse编写python(配置PyDev插件)
下载,安装python解释器 地址:https://www.python.org/downloads/ 下载,安装java jdk 地址:http://www.oracle.com/technetwo ...
- Note1: windows下Python IDE(Eclipse+Pydev)
毕设想做一个个性化音乐推荐系统,真的是从零开始学起,通过<推荐系统实践>大致地了解了一些基础知识,目前在啃<集体智慧编程>. 选用的开发环境是 Eclipse+Pydev . ...
- 【转】使用Eclipse搭建Python开发环境
因为要进行自动化测试,所以要搭建Python开发环境.这里将使用Eclipse+pyDev进行搭建,在此作为笔记记录下来. 需要的组件: 1.Eclipse SDK 3.7(这里将不再叙述Eclips ...
随机推荐
- 20145302张薇《网络对抗技术》PC平台逆向破解
20145302张薇<网络对抗技术>PC平台逆向破解 实验任务 1.简单shellcode注入实验 2.Return-to-libc 攻击实验 实验相关原理 Bof攻击防御技术 从防止注入 ...
- 2018-2019-1 20189218《Linux内核原理与分析》第二周作业
问题一 动态库链接找不到库问题 这个问题当时确实对我造成了很大的困扰,虽然最终仍然成功用动态库链接但是问题并没有解决.现在回过头来看却觉得有点蠢,但出错的过程仍然值得总结.首先看我的目录结构: 可以看 ...
- Javaworkers团队第二周项目总结
本周项目进展 本周我们小组成员在图书馆和网上查阅了很多资料,基本达到了预期的计划,完成了项目框架设计及代码模块设计. 设计思路 1.首先,根据用户需求合理分配代码密度,即: 用户直接操作(点击运行)的 ...
- kali_常用软件记录
可参考:http://www.lvzejun.cn/2015/03/31/ubuntu-software/ 录屏软件 http://www.kohaupt-online.de/hp/ http://l ...
- SPOJ BALNUM Balanced Numbers(数位DP+状态压缩)题解
思路: 把0~9的状态用3进制表示,数据量3^10 代码: #include<cstdio> #include<map> #include<set> #includ ...
- 获取lambda表达式类型,获取attributes是注意事项
1.获取lambda表达式的MemberExpression所属类的类型,要使用:m.Expression.Type 而不要使用 m.Member.DeclaringType: 后者获取的是实际定 ...
- LA 7277 Landscaping(最小割)
https://vjudge.net/problem/UVALive-7277 题意: 给出一个n*m的地图,.代表低坡,#代表高坡. 现在有n+m辆车分别从上端和左端出发,如果在行驶的过程中需要转换 ...
- SQL——DDL简单语句
基于MySQL的: status 命令查看MySQL当前信息 show databases; 命令列出所有数据库模式 use test; use命令切换到指定数据库模式 show tables; 列出 ...
- tp5.1 Env使用
5.1版本取消了所有的系统常量,原来的系统路径变量改为使用Env类获取(需要引入think\facade\Env) echo "app_path=========".Env::ge ...
- SSH防止暴力破解--fail2ban
一.ssh密钥对无交互登录 实战1:通过密钥进行sshd服务认证 服务端:linl_S IP:10.0.0.15 客户端:lin_C IP:10.0.0.16 1)在客户端生成密钥对 ...