Python/Qt Code Editor widget
Project description
What is pyQode?
pyQode is a flexible source code editor widget for Python Qt applications. pyQode is a library/widget, not an IDE. You can see it as an alternative to QScintilla.
pyQode is a namespace package made up of the following official packages:
pyqode.core: core package
pyqode.python: python support (code completion, …)
pyqode.widgets: useful widgets for pyqode apps
pyqode.designer: Starts Qt designer with all pyqode plugins
pyqode.core is the foundation package, it contains the pyqode base classes (QCodeEdit, Mode, Panel) and a set of builtin modes and panels that are useful for any kind of code editor. With pyqode.core you can already create a generic code editor (similar to gedit, notepad++) with only a few lines of code.
Features
Here are the core features:
supports PySide and/or PyQt4
supports Python 2 and/or Python 3
simple widget based on QPlainTextEdit
easily customisable (modes and panels)
native look and feel close to Qt creator
builtin modes and panels (folding, line number, code completion, syntax highlighting)
Qt Designer plugin
License
pyQode is licensed under the MIT license.
Requirements
pyqode.core depends on the following libraries:
Python 2.7 or Python 3 (>= 3.2)
PyQt4 or PySide
pygments
Installation
You need to install PyQt4 or PySide by yourself.
Then you can install pyqode using pip:
$ pip install pyqode.core
Usage
The public API is exposed by the pyqode.core package.
Here is a simple example using PyQt4:
# simple example using PyQt4
import sys
import PyQt4 # just to tell pyqode we want to use PyQt4.
import pyqode.core
from PyQt4.QtGui import QApplication
def main():
app = QApplication(sys.argv)
editor = pyqode.core.QGenericCodeEdit()
editor.openFile(__file__)
editor.resize(800, 600)
editor.show()
return app.exec_()
if __name__ == "__main__":
sys.exit(main())
Resources
Screenshots
Here are a few screenshots of the gui integration example on several different platforms:
Windows 7:
Ubuntu:
Linux Mint:
KDE:
KDE with a dark color scheme:
Gnome:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.