pydev

python+Eclipse+pydev环境搭建

喜欢而已 提交于 2020-01-16 13:20:51
本文重点介绍使用Eclipse+pydev插件来写Python代码, 以及在Mac上配置Eclipse+Pydev 和Windows配置Eclipse+Pydev 转载:https://www.cnblogs.com/Bonker/p/3584707.html 编辑器:Python 自带的 IDLE 简单快捷, 学习Python或者编写小型软件的时候。非常有用。 编辑器: Eclipse + pydev插件 1. Eclipse是写JAVA的IDE, 这样就可以通用了,学习代价小。 学会了Eclipse, 以后写Python或者JAVA 都可以。 2. Eclipse, 功能强大。 3. Eclipse跨平台, 可以在Mac上和Windows运行 安装Python 下载地址:http://www.python.org/ Python 有 Python 2 和 Python 3 两个版本。 语法有些区别。 保险起见, 我安装Python 2.7.6 安装JAVA JDK 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html Eclipse 需要这个安装好JAVA JDK后才能运行 下载Eclipse http://www.eclipse.org/downloads/ 到这下载。 下载完后

PyDev can't see class from PyTables

ぃ、小莉子 提交于 2020-01-15 20:10:38
问题 I've installed pytables under windows 7 64 bit and it passes all the tests. Both python from command prompt and IDLE can successfully see the StringCol class, and even the python console in Eclipse can see it. However, PyDev's autocomplete can't discover the class, and editor keeps displaying an error that says undefined variable: StringCol Despite the error, the following code runs successfully in eclipse, using PyDev from tables import * if __name__ == '__main__': a = StringCol(34) print (a

How to run a module inside a package, using relative imports?

試著忘記壹切 提交于 2020-01-15 09:13:09
问题 This question is specific to PyDev. The package structure looks like this: app ├── __init__.py ├── sub1 │ ├── __init__.py │ └── mod1.py └── sub2 ├── __init__.py └── mod2.py The mod1.py module: from __future__ import print_function def f(): print('It works!') The mod2.py module: from __future__ import absolute_import from ..sub1 import mod1 if __name__ == '__main__': mod1.f() Everything works beautifully from the shell , the python -m app.sub2.mod2 command prints: It works! as expected, all is

How to run a module inside a package, using relative imports?

冷暖自知 提交于 2020-01-15 09:09:26
问题 This question is specific to PyDev. The package structure looks like this: app ├── __init__.py ├── sub1 │ ├── __init__.py │ └── mod1.py └── sub2 ├── __init__.py └── mod2.py The mod1.py module: from __future__ import print_function def f(): print('It works!') The mod2.py module: from __future__ import absolute_import from ..sub1 import mod1 if __name__ == '__main__': mod1.f() Everything works beautifully from the shell , the python -m app.sub2.mod2 command prints: It works! as expected, all is

How to run a module inside a package, using relative imports?

こ雲淡風輕ζ 提交于 2020-01-15 09:08:02
问题 This question is specific to PyDev. The package structure looks like this: app ├── __init__.py ├── sub1 │ ├── __init__.py │ └── mod1.py └── sub2 ├── __init__.py └── mod2.py The mod1.py module: from __future__ import print_function def f(): print('It works!') The mod2.py module: from __future__ import absolute_import from ..sub1 import mod1 if __name__ == '__main__': mod1.f() Everything works beautifully from the shell , the python -m app.sub2.mod2 command prints: It works! as expected, all is

python安装手记

一世执手 提交于 2020-01-15 01:41:18
一.下载python https://www.python.org/downloads/windows/ 下载安装后就可以使用IDLE 二.下载jdk:jdk-8u181-windows-x64.exe https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 在oracle下载速度慢,还要注册账号,所以你可以用别人网盘里面下好的 https://pan.baidu.com/s/1Ev-9iaN-HOqAh45EVPUNCA 密码:0lpp 安装后设置Java_home的环境变量 三.下载eclipse安装 http://www.eclipse.org/downloads 四.下载python的pydev插件 http://sourceforge.net/projects/pydev/files/,下载后解压缩后,将解压文件拷贝到eclipse目录下面 启动eclipse,但是在设置pydev插件的时候回遇到错误: 无法创建选择的首选项页面。 自动激活 bundle org.python.pydev 时出错(449)。 原因大多是因为版本不匹配。这个方法不行,那就换一种方法,自动安装:eclipse--帮助--安装新软件 添加:Pydev - http://pydev

PyDev console working directory

谁说我不能喝 提交于 2020-01-13 18:04:58
问题 When I open a PyDev console, the current working directory is my Eclipse folder. How can I configure the console to use the project folder as the current working directory? Can this be set workspace-wide? This question is related, but unhelpful as the directory is hard coded. So far, I've discovered that the Eclipse run configuration variable ${project_loc:/selected project name} cannot be used with Python's os.chdir() . 回答1: If you go to Windows -> Preferences -> PyDev -> Interpreter, you

Tell pydev to exclude an entire package from analysis?

眉间皱痕 提交于 2020-01-13 04:37:07
问题 Today I'm on a mission to remove little red X's from my django project in pydev. Mostly, this involves fixing import problems with pydev. I'm using South for database migrations. South (if you don't know) generates python modules, and pydev doesn't like them. I don't want to edit the south code since it's generated. Is there a way to instruct pydev to exclude certain packages from analysis? Something like #@UndefinedVariable , except for the entire module? Ideally I'd like to ignore packages

pydev syntax highlighting python builtins

南笙酒味 提交于 2020-01-13 02:54:31
问题 Is there any way to make Eclipse/PyDev highlight the Python built-in functions? For example, the Python IDLE highlights int() or list() but PyDev doesn't. I'm using Eclipse 3.7.1 and PyDev 2.2.3. 回答1: Currently that's not really possible in PyDev. Please enter a feature request for that. See: http://pydev.org/about.html for details on where to report it... 来源: https://stackoverflow.com/questions/7770760/pydev-syntax-highlighting-python-builtins

Python curses Redirection is not supported

♀尐吖头ヾ 提交于 2020-01-12 14:05:42
问题 I am trying to use Curses in PyDev in Eclipse in Win7. I have installed Python 3.2 (64bit) and curses-2.2.win-amd64-py3.2. When I input the following testing codes into PyDev: import curses myscreen = curses.initscr() myscreen.border(0) myscreen.addstr(12, 25, "Python curses in action!") myscreen.refresh() myscreen.getch() curses.endwin() It did not show any syntax error, so I think the curses was installed correctly. However, when I ran it as Python Run, the output showed: Redirection is not