pydev 上的 python 自动完成功能不好?
大约一个月前,我开始学习并爱上Python。深入研究 python、django,现在 Tornado 是我这段时间所遵循的道路。 我选择 pydev 作为 IDE,因为它似乎是最新的,而且我想回到 eclipse,因为我正在使用 Netbeans 来处理 php 和 Java。
我的问题如下: 当我用 php 或 java 编写类时,我声明我的方法和属性。我在其他地方实例化它们并使用它们。自动补全对于java和php来说效果很好,但是对于python,它似乎总是向我建议一堆垃圾,而不是我实例化的类中的真实对象的方法。
你也一样吗?这是 pydev 的限制吗?我做错了什么吗?
预先感谢您为我指明了方向。 马修.
I began learning and loving python about a month ago. Dive into python, django and now Tornado is the path i followed during this time.
I chose pydev as an IDE since it seems to be the most up to date and i wanted to come back to eclipse since i'm using Netbeans for php and Java.
My question is the following:
When i write classes in php or java i declare my methods and properties. I instantiate them somewhere else and use them. The autocompletion works great for java and php but with python, it seems to be always suggesting me a bunch of garbage and never the real object's methods from the class i instantiated.
Is it the same for you ? Is it a limitation from pydev ? Am i doing something wrong ?
Thank you in advance for pointing me in a direction.
Matthieu.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先确保您的解释器设置正确。
我在 Linux 上使用 cpython,所以我的解释器位于
库下,确保所有标准 PYTHONPATH 内容都在其中:
您还可以通过单击“新建文件夹”在此处添加任何非标准路径。
不过,请勿将路径添加到您自己的源代码中。当您配置 pydev 项目、选择“src”文件夹并开始制作模块时,这些应该出现,请参阅此处。
First make sure your interpreter is set up correctly.
I use cpython on linux so my interpreter is
Under Libraries, make sure all the standard PYTHONPATH stuff is in there:
You can also add any non standard paths here by clicking New Folder.
Do not add paths to your own source code though. These should come in when you configure a pydev projec, select a "src" folder and start making modules, see here.
好吧,由于您没有说“垃圾”正在显示什么,所以有点难以猜测,但我相信您指的是对象类中的 __hash__、__str__、 等(是吗?)
如果是这种情况,则已在当前的夜间构建中处理了这个问题(“_”方法仍然会出现,但优先级较低,因此,您可能更感兴趣的方法位于顶部)
Well, as you didn't say what 'garbage' is showing, it's a bit hard to guess, but I believe you mean the
__hash__, __str__,
etc from the object class (is that it?)If that's the case, this has been dealt in the current nightly build (the '_' methods will still appear, but with lower priority, so, the methods you're probably more interested in are at the top)
Pycharm (http://www.jetbrains.com/pycharm/index.html)除其他外,在自动完成方面比 Pydev 好得多。
Pycharm (http://www.jetbrains.com/pycharm/index.html) is much better than Pydev for auto completion, among other things.