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 ?
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/Komodo Edit and a CIX file (download here) that I hacked together not so long ago:
and,
Edit: Installation instructions for Komodo 5:
- Edit -> Preferences -> Code Intelligence
- Add an API Catalog...
- Select CIX file, press Open
- There is no point 4.
</shameless-plug>
What about WingIDE, It's not free but it's Feature List has "auto-completion for wxPython, PyGTK, and PyQt "
来源:https://stackoverflow.com/questions/1167065/autocompletion-not-working-with-pyqt4-and-pykde4-in-most-of-the-ides