Client library for Sidekick Visual Coding Buddy
Project description
Sidekick Python Library (sidekick-py)
This library provides the Python interface for interacting with the Sidekick Visual Coding Buddy frontend UI, typically running within VS Code. It allows your Python scripts to easily create, update, and interact with visual modules like grids (Grid), consoles (Console), variable visualizers (Viz), drawing canvases (Canvas), and UI controls (Control).
Installation
Install the library using pip:
pip install sidekick-py
You will also need the Sidekick VS Code extension installed and running in VS Code.
Minimal Usage Example
First, open the Sidekick panel in VS Code (Press Ctrl+Shift+P, search for and run Sidekick: Show Panel).
Then, save and run the following Python script:
import sidekick
# 1. Create a 16x16 Grid
grid = sidekick.Grid(16, 16)
# 2. Define what happens when a cell is clicked
def handle_click(x, y):
# Update the clicked cell in the Sidekick UI
grid.set_color(x, y, 'red')
print(f"Cell ({x}, {y}) clicked!") # Optional: Print to terminal
# 3. Register the click handler
grid.on_click(handle_click)
# 4. Keep the script running to listen for clicks!
# Without this, the script would end, and clicks wouldn't be handled.
sidekick.run_forever()
After running the script, clicking the grid cells in the Sidekick panel will turn them red. Press Ctrl+C in the terminal to stop.
Learn More
- Sidekick GitHub Repository
- Explore the Examples Directory.
- Read the Python API Reference.
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
File details
Details for the file sidekick_py-0.0.5.tar.gz.
File metadata
- Download URL: sidekick_py-0.0.5.tar.gz
- Upload date:
- Size: 85.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1df21d9651de398d36cba9d980f662990402c0a8db8068a2655162bfbef87b9
|
|
| MD5 |
709dca60e1ccd83f94d923f3f51aa569
|
|
| BLAKE2b-256 |
cd1b31c160b7a91d331602545b39b299dd26be92f75bc8ed29530b8769b937f0
|