Skip to content

ogranada/pyqode.core

 
 

Repository files navigation

Python/Qt Code Editor Widget library

Travis-CI build status

Number of PyPI downloads

Latest PyPI version

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 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:

Windows 7

  • Ubuntu:

Ubuntu

  • Linux Mint:

Linux mint

  • KDE:

KDE

  • KDE with a dark color scheme:

KDE dark

  • Gnome:

Gnome

Bitdeli badge

Packages

No packages published

Languages

  • Python 99.0%
  • Shell 1.0%