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

  1. Launch Eclipse
    1. Launch Eclipse. A screen like this should appear, where you can choose which workspace to open. (If not, go to File → Switch Workspace → Other )

    2. Screenshots read 'Python 3.1', which is the old version. You will be installing Python 3.2.
    3. Browse the csse120 folder which you created when installing Eclipse. Select "Use this as the default and do not ask again".

      1. 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.

    4. 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.

  2. Download PyDev from within Eclipse
    1. Go to Help → Install New Software  
    2. Enter http://pydev.org/updates in the Work with:  field.

    3. After several seconds, two options should appear. Select the PyDev for Eclipse option. Do not select the "PyDev Mylyn Integration" flag.

    4. Click "Next" and "OK" to continue installing PyDev.
    5. Select "I accept the terms of the license agreement", then click "Finish". The installer will begin to download the plug-in.
    6. 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.
    7. 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.
    8. 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.
  3. Configure PyDev
    1. Python must be installed to configure PyDev.
    2. Go to Window → Preferences. In the Preferences window, expand PyDev and select Interpreter-Python.

    3. 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.

    4. 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.
    5. 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

  1. Download the Eclipse Preferences
    1. 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).

  2. Import the Preferences
    1. Launch Eclipse.

      1. If Eclipse offers to Select a Workspace, browse to C:\EclipseWorkspace\csse120.

      2. If the csse 120 workspace does not appear automatically, choose File → Switch Workspace → Other, and click Next.

    2. Now you are ready to set the preferences for the workspace:

      1. Choose File → Import

      2. In the Import dialog box, select General → Preferences and click Next.

      3. When the Import Preferences dialog opens, select Browse and find the EclipsePreferences-2011-06.epf file that you unzipped and saved above.

      4. Back in the Import Preferences dialog, check Import All, then select Finish.

      5. As before, if the Subclipse Usage dialog makes an appearance, uncheck the box and continue.

      6. Confirm that the installation did not leave behind unintended files by checking if there is:

        1. random .eclipse folder anywhere, possibly in the folder immediately above My Documents.

        2. Any extra users (for example, the installer), in C:\Users

        3. Extra Eclipse workspaces anywhere except for the folders inside C:\EclipseWorkspaces.

Writing Your First Python Program

  1. Switch to the Python perspective
    1. 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".

    2. 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.

  2. Create a new project
    1. Go to File → New → PyDev Project to start a wizard.
    2. 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.

    3. 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.

  3. Create a new module
    1. 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.

    2. 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.

  4. Write and run the program
    1. 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.

    2. Right click on the file and select Save (or press Ctrl+S) to save the file.

    3. 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.)

    4. 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

    1. Add line numbers
      1. Add line numbers by right-clicking in the margin at the left side of the code view and click on Show Line Numbers.
    2. Change the comment color to one you can read more easily
      1. 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?).

    3. Turn on Task view  to show TODO: items and add a CONSIDER: tag
      1. Go to Window → Show View → Tasks.
      2. Window → Preferences → PyDev → Task Tags, and add CONSIDER: to the end of the list.
      3. To get the task tags to show, run the program once, or select Project → Clean

How to Configure Eclipse for Python --- 在eclipse中如何配置pydev的更多相关文章

  1. python 笔记1:安装python;eclipse中安装配置pydev

    1  下载安装python. 官网:https://www.python.org/downloads/     根据自己的操作系统选择需要的版本下载并安装. 我的电脑操作系统windows xp的,只 ...

  2. python 笔记1:官网下载及安装python;eclipse中安装配置pydev

    1  下载安装python. 官网:https://www.python.org/downloads/     根据自己的操作系统选择需要的版本下载并安装. 我的电脑操作系统windows xp的,只 ...

  3. 使用eclipse作为python开发工具安装旧版pydev

    在Eclipse中: Help->Install New Software add之后输入的链接地址 https://dl.bintray.com/fabioz/pydev/old/ 如果使用从 ...

  4. python 在sublime 中的配置

    首先可以先装package control 方法——按ctrl+`,然后在命令行里复制粘贴以下代码, import urllib2,os;pf='Package Control.sublime-pac ...

  5. windows下python+Django+eclipse开发环境的配置

    1.JDK环境的安装 在http://www.java.com/zh_CN/download/faq/develop.xml 页面下,点击JDK下载,下载所需的jdk版本.直接点击安装即可. 2.py ...

  6. windows下搭建eclipse关于python的开发环境及初始化参数配置

    1.安装jdk 因为eclipse是java开发的,运行eclipse程序需要安装jdk 安装jdk以后需要配置java_home环境变量 2.安装python2.7(比较简单,此处略) 3.下载ec ...

  7. [No000076]用Eclipse编写python(配置PyDev插件)

    下载,安装python解释器 地址:https://www.python.org/downloads/ 下载,安装java jdk 地址:http://www.oracle.com/technetwo ...

  8. Note1: windows下Python IDE(Eclipse+Pydev)

    毕设想做一个个性化音乐推荐系统,真的是从零开始学起,通过<推荐系统实践>大致地了解了一些基础知识,目前在啃<集体智慧编程>. 选用的开发环境是 Eclipse+Pydev . ...

  9. 【转】使用Eclipse搭建Python开发环境

    因为要进行自动化测试,所以要搭建Python开发环境.这里将使用Eclipse+pyDev进行搭建,在此作为笔记记录下来. 需要的组件: 1.Eclipse SDK 3.7(这里将不再叙述Eclips ...

随机推荐

  1. 20145328 《网络对抗技术》逆向及Bof基础实践

    20145328 <网络对抗技术>逆向及Bof基础实践 实践内容 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回 ...

  2. JQuery+CSS3实现Ajax加载时loading效果

    之前通过Ajax请求加载数据的时候,在数据还没有呈现出来前,为了更好的用户体验,总会弄个loading告诉用户其实内容正在加载,而不是网站崩了.但是貌似之前使用gif图片的情况比较多,可能是为了兼容各 ...

  3. InstallShield 2015 Premier的Basic MSI Project如何在卸载时删除残留的文件 (转)

    转载:http://blog.csdn.net/zztoll/article/details/54018615#comments 先说下缘由,我在用InstallShield 2015 Premier ...

  4. NGS检测ALK融合大起底--转载

    导读: ALK融合是非小细胞肺癌的关键驱动机制之一,在NSCLC患者中发生的频率约为3-7%.针对ALK融合的抑制剂克唑替尼.色瑞替尼以及Alectinib在治疗ALK融合阳性的NSCLC患者中都取得 ...

  5. pairs 和 ipairs区别

    local tab= { [] = "a", [] = "b", [] = "c" } for i,v in pairs(tab) do - ...

  6. 读写 Excel 工作表

    导入诸如 CSV 之类文本格式的数据的优点是不需要依靠某些特定软件来读取数据,并且文件具有可读性,即软件中性.然而,它的缺点也很明显——我们不能直接对文本编辑器中的数据执行计算操作,因为这些内容是纯文 ...

  7. JAVA技术分享:消失的线程

    很多小伙伴都问过我一个问题,就是任务线程跑着跑着消失了,而且没有任何异常日志.我都是条件反射式的回复,是不是用了线程池的submit提交任务.而且很大几率对方给予肯定答复. 解决方案,很多人都听过不少 ...

  8. tenserflow models包的安装

    1.下载 models包 https://github.com/tensorflow/models 2.将models包拷贝到本机Python包的安装地址即可,本机Python包的安装地址的查看方式可 ...

  9. mfc "缺少函数标题(是否是老式的形式表)"的总结

    首先出现这种问题要定位到程序中出错的地方查看,如果没有问题就仔细看类的声明和定义.可能是对应类的后面没有加: 第二个原因是可能忘记了添加头文件 "stdafx",如果是这样可以加上 ...

  10. jquery属性值选择器

    $("[attribute|='value']") 选择指定属性值等于给定字符串或改字符串为前缀(该字符串后跟一个连字符“-”)的元素. attribute: 一个属性名 valu ...