{"id":49092993,"url":"https://github.com/jacobwilliams/qonsole","last_synced_at":"2026-04-20T19:11:09.661Z","repository":{"id":349907335,"uuid":"1202160069","full_name":"jacobwilliams/qonsole","owner":"jacobwilliams","description":"Embed a Python interpreter in PySide/PyQt applications","archived":false,"fork":false,"pushed_at":"2026-04-17T04:03:32.000Z","size":671,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-17T05:32:54.605Z","etag":null,"topics":["ipython","pygments","pyqt6","pyside6","python","qt","terminal"],"latest_commit_sha":null,"homepage":"https://jacobwilliams.github.io/qonsole","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwilliams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-05T17:16:56.000Z","updated_at":"2026-04-17T04:03:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jacobwilliams/qonsole","commit_stats":null,"previous_names":["jacobwilliams/qonsole"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jacobwilliams/qonsole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fqonsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fqonsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fqonsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fqonsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwilliams","download_url":"https://codeload.github.com/jacobwilliams/qonsole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fqonsole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32061436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipython","pygments","pyqt6","pyside6","python","qt","terminal"],"created_at":"2026-04-20T19:11:09.498Z","updated_at":"2026-04-20T19:11:09.649Z","avatar_url":"https://github.com/jacobwilliams.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/jacobwilliams/qonsole/master/media/qonsole.png\" width=400\"\u003e\n\u003c/h1\u003e\n\n\u003c!-- Badges --\u003e\n\u003cp align=\"left\"\u003e\n  \u003c!-- Python version badge --\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/language-python-blue.svg\" alt=\"Python\"\u003e\u003c/a\u003e\n  \u003c!-- PyPI badge --\u003e\n  \u003ca href=\"https://pypi.org/project/qonsole/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/qonsole.svg\" alt=\"PyPI\"\u003e\u003c/a\u003e\n  \u003c!-- conda-forge badge --\u003e\n  \u003ca href=\"https://anaconda.org/conda-forge/qonsole\"\u003e\u003cimg src=\"https://img.shields.io/conda/vn/conda-forge/qonsole.svg\" alt=\"Conda-Forge\"\u003e\u003c/a\u003e\n  \u003c!-- GitHub Actions CI badge --\u003e\n  \u003ca href=\"https://github.com/jacobwilliams/qonsole/actions\"\u003e\u003cimg src=\"https://github.com/jacobwilliams/qonsole/actions/workflows/tests.yml/badge.svg\" alt=\"GitHub CI Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jacobwilliams/qonsole/actions\"\u003e\u003cimg src=\"https://github.com/jacobwilliams/qonsole/actions/workflows/publish.yml/badge.svg\" alt=\"GitHub CI Status\"\u003e\u003c/a\u003e\n  \u003c!-- Codecov badge --\u003e\n  \u003ca href=\"https://codecov.io/gh/jacobwilliams/qonsole\"\u003e\u003cimg src=\"https://codecov.io/gh/jacobwilliams/qonsole/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# About\n\nQonsole is a lightweight Python console for Qt applications. It's made to\nbe easy to embed in other PySide/PyQt applications and comes with some examples that\nshow how this can be done. The interpreter can run in a separate thread, in\nthe UI main thread or in a gevent task. Qonsole is a fork of [pyqtconsole](https://github.com/pyqtconsole/pyqtconsole). The two diverged at pyqtconsole v1.3.0, and it is not quite a drop-in replacement, but does implement new features and has various improvements.\n\n## Simple usage\n\nThe following snippet shows how to create a console that will execute user\ninput in a separate thread. Be aware that long running tasks will still block\nthe main thread due to the GIL. See the ``examples`` directory for more\nexamples.\n\n```python\nimport sys\nfrom threading import Thread\nfrom PyQt5.QtWidgets import QApplication\n\nfrom qonsole import PythonConsole\n\napp = QApplication([])\nconsole = PythonConsole()\nconsole.show()\nconsole.eval_in_thread()\n\nsys.exit(app.exec_())\n```\n\n## Embedding\n\n* *Separate thread* - Runs the interpreter in a separate thread, see the\n  example `threaded.py`. Running the interpreter in a separate thread obviously\n  limits the interaction with the Qt application. The parts of Qt that needs\n  to be called from the main thread will not work properly, but is excellent\n  way for having a 'plain' python console in your Qt app.\n\n* *main thread* - Runs the interpreter in the main thread, see the example\n  `inuithread.py`. Makes full interaction with Qt possible, lenghty operations\n  will of course freeze the UI (as any lenghty operation that is called from\n  the main thread). This is a great alternative for people who does not want\n  to use the gevent based approach but still wants full interactivity with Qt.\n\n* *gevent* - Runs the interpreter in a gevent task, see the example\n  `_gevent.py`. Allows for full interactivity with Qt without special\n  consideration (at least to some extent) for longer running processes. The\n  best method if you want to use pyQtgraph, Matplotlib, PyMca or similar.\n\n## Features\n\n### Syntax highlighting\n\nSyntax highlighting is provided by the [https://pygments.org](pygments) library.\nSimply pass the Pygments style string to the ``PythonConsole`` constructer like so:\n\n```python\nconsole = PythonConsole(pygments_style='github-dark')\n```\n\n### Magic commands\n\nCommands that start with `%` are magic commands.\nThis features provides IPython-like [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html) such as:\n\n * `%pwd` -- Print current working directory\n * `%cd` -- Change directory\n * `%ls` -- List directory contents\n * `%who` -- List variable names in the current namespace\n * `%whos` -- Display detailed variable information\n * `%timeit` -- Time the execution of a Python statement\n * `%run` -- Execute a Python script file\n * `%clear` -- Clear the console display\n * `%export` -- Export console session as Python script (.py) or Jupyter notebook (.ipynb)\n * `%help` -- Display help message for magic commands\n\n In addition, custom magic commands can be defined by using the `add_magic_command()` method. Example:\n\n```python\ndef version(args=None):\n    return '3.2.1'\n\nconsole = PythonConsole()\nconsole.add_magic_command(\"version\", version)\n```\n\nWhich can be used like so:\n\n```\n   IN [0]: %version\n           3.2.1\n```\n\n### Clear console\n\nA local method, named `clear()`, is available to clear the input screen and reset the line numbering.\nEnable it by pushing the method into the available namespace in the console:\n\n```python\n   console.interpreter.locals[\"clear\"] = console.clear\n```\n\n### Shell commands\n\nCommands entered in the console that start with `!` will be executed as shell commands.\nThe output of the command will be printed in the console.\nFor example, on a Linux or macOS system, entering `!ls -l` will list the files in the current directory. Example:\n\n```\n   IN [0]: !ls -l\n   OUT[0]: total 16546\n           -rw-r--r-- 1 user user      18741 Fen  6  2026  file1.txt\n           -rw-r--r-- 1 user user      18741 Feb  6  2026  file2.txt\n```\n\n### Prompt String\n\nBy default ``IN [n]:`` and ``OUT [n]:`` are displayed before each input and output line.\nYou can customize this through constructor arguments:\n\n```python\n# Including the line numbers:\nconsole = PythonConsole(inprompt=\"%d \u003e\", outprompt=\"%d \u003c\")\n# Or just static:\nconsole = PythonConsole(inprompt=\"\u003e\u003e\u003e\", outprompt=\"\u003c\u003c\u003c\")\n```\n\n### Right-click menu\n\nThe console's right-click menu includes several useful items:\n\n* \"Copy\"\n* \"Paste\"\n* \"Select All\"\n* \"Clear Console\" (same as the `%clear` magic command)\n* \"Export Session\" (same as the `%export` magic command)\n* \"Toggle Word Wrap\"\n\n## Credits\n\nThis module depends on [QtPy](https://github.com/spyder-ide/qtpy) which provides a compatibility layer for\nQt. The console is tested under both Qt5 and Qt6.\n\n## Development\n * [Repository at GitHub](https://github.com/jacobwilliams/vibehdf5)\n * To generate coverage information for the unit tests, run `pixi run \"coverage run -m pytest tests/ \u0026\u0026 coverage report -m \u0026\u0026 coverage html\"`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fqonsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwilliams%2Fqonsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fqonsole/lists"}