views:

658

answers:

2

I am trying to develop a plasmoid using python. I have tried eclipse with pydev, vim with pythoncomplete, PIDA and also Komodo, but none of them could give me autocmpletion for method names or members for the classes belonging to PyQT4 or PyKDE4. I added the folders in /usr/share/pyshare in the PYTHONPATH list for the IDEs.

Do I need to do something else ?

+4  A: 

There is a number of ways to do it, PyQt4 provides enough information about method names for any object inspecting IDE:

>>> from PyQt4 import QtGui
>>> dir(QtGui.QToolBox) 
['Box', ... contextMenuPolicy', 'count', 'create', 'currentChanged'...]

All those functions are built-in. This means that you have to push some IDEs slightly to notice them. Be aware that there are no docstrings in compiled PyQt and methods have a funny signature.

Other possibility is using QScintilla2 and.api file generated during PyQt4 build process. Eric4 IDE is prepared exactly for that.

<shameless-plug>
You can also try Komodo IDE/Edit and a CIX file that I hacked together not so long ago:
Screenshot1 Screenshot2 Download

Edit: Installation instructions for Komodo 5:

  1. Edit -> Preferences -> Code Intelligence
  2. Add an API Catalog...
  3. Select CIX file, press Open
  4. There is no point 4.

</shameless-plug>

wuub
The pydev solution didn't help. I am using Eclipse 3.5 and pydev 1.4.7. I will try the solution with Komodo and let you know.
rangalo
Hey, how to use that cix file ? I am pretty new to Komodo, is it a kind of extension ?
rangalo
@rangalo: I edited the post to include installation instructions.
wuub
Thanks that worked !
rangalo
A: 

What about WingIDE, It's not free but it's Feature List has "auto-completion for wxPython, PyGTK, and PyQt "

sunqiang