Skip to main content

An IDLE-like debugger to allow for real-time command injection for debugging and testing python code

Project description

PYSOLE

You can finally test your code in real time without using idle!

If you found this repository useful, please give it a ⭐!.

Showcase (click to watch on Youtube)

Watch the demo

A fully-featured, live Python console GUI built with CustomTkinter and Tkinter, featuring:

  • Python syntax highlighting via Pygments

  • Autocomplete for keywords, built-ins, and local/global variables

  • Run code at startup for easier debugging

  • Thread-safe execution of Python code

  • Output capturing for stdout and stderr

  • Multi-line input with auto-indentation

  • History of previous commands

  • Integrated Help Panel for quick access to Python object documentation

Installation

pip install liveConsole

Features

Standalone Launch

  • Once installed, you can launch the console directly by simply typing pysole or liveconsole in the terminal

  • This opens the full GUI without needing to write any code. Perfect for quick debugging and experimenting.

Syntax Highlighting

  • Real-time syntax highlighting using Pygments and the Monokai style.

  • Highlights Python keywords, built-ins, and expressions in the console.

Run Code at Startup

  • Pysole can automatically execute Python code when the console launches.

  • Use the runRemainingCode=True argument in pysole.probe() to run all remaining lines in the calling script after the probe() call.

  • The printStartupCode flag controls whether these lines are printed in the console as they execute (True) or run silently (False).

  • Useful for initializing variables, importing libraries, or setting up your environment automatically.

Autocomplete

  • Suggests keywords, built-in functions, and variables in scope.

  • Popup list appears after typing at least 2 characters.

  • Only inserts the missing portion of a word.

  • Navigate suggestions with Up/Down arrows, confirm with Tab/Return.

Multi-Line Input

  • Supports Shift+Enter for inserting a new line with proper indentation.

  • Automatically detects incomplete statements and continues the prompt.

Thread-Safe Execution

  • Executes user code in a separate thread to prevent GUI freezing.

  • Captures both stdout and stderr output and prints them in the console.

  • Supports both expressions (eval) and statements (exec).

Clickable History

  • Hover previous commands to see them highlighted.

  • Click to copy them back to the prompt for editing or re-execution.

Help Panel

  • A resizable right-hand panel that displays Python documentation (help()) for any object.

  • Opens when clicking ctrl+click on a function/method and can be closed with the "X" button.

  • Scrollable and syntax-styled.

  • Perfect for quick reference without leaving the console.

Easy Integration

  • Automatically grabs caller frame globals and locals if not provided.

  • Can be used standalone or embedded in larger CustomTkinter applications.

Usage

import pysole
pysole.probe()

or for also running some code at the startup of the pysole

import pysole
pysole.probe(runRemainingCode=True,   #< for executing the code below probe
             printStartupCode=True    #< for printing the command as well as it output
             )
x = 1                                 #< initialize some variable
print(x)                              #< print the variable on the console
  • Type Python commands in the >>> prompt and see live output.

Keyboard Shortcuts

Key Action
Enter Execute command (if complete)
Shift+Enter Insert newline with auto-indent
Tab Complete the current word / show suggestions
Up/Down Navigate suggestion list
Escape Hide suggestions
Mouse Click Select previous command from history

Customization

  • Appearance mode: Dark mode is default, but can be changed via files menu

  • Themes: Pysole has multiple preconfigured themes. You can choose a theme via the Theme Picker, which updates the console colors and appearance. Preconfigured themes are loaded from themes.json and the selected theme is saved in settings.json so it persists across sessions.

License

MIT License – free to use, modify, and distribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liveconsole-1.7.5.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liveconsole-1.7.5-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file liveconsole-1.7.5.tar.gz.

File metadata

  • Download URL: liveconsole-1.7.5.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for liveconsole-1.7.5.tar.gz
Algorithm Hash digest
SHA256 1c4625369f7513cf0d44eb34a0db02a0abdbf6156865fbb482382e929b752e16
MD5 ed5b9b900cc7ff0c15985edd7bb0a876
BLAKE2b-256 4c228161f1328e03b739d9ab10493db840f27a81b7f275cfd7fc9b3c47381f48

See more details on using hashes here.

File details

Details for the file liveconsole-1.7.5-py3-none-any.whl.

File metadata

  • Download URL: liveconsole-1.7.5-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for liveconsole-1.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c57b9e4e5ed66af83f778e4a98499af294d463e2a823774cb76467e7ea291dd3
MD5 756cfad9bcb8c9f3608491b2d57fc597
BLAKE2b-256 ae7319c0163c871220a23467f8d75faee3941ab7faff1eb732f2b660792f73c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page