From 9e4830f1e2d304c65b2701cc46ace3fc9bf2cab3 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sun, 17 Nov 2024 16:11:54 +0800 Subject: [PATCH] docs: Add details about developing python Signed-off-by: Daniel Schaefer --- python/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/python/README.md b/python/README.md index 80b3fd2..921e9cc 100644 --- a/python/README.md +++ b/python/README.md @@ -165,3 +165,38 @@ Bus 003 Device 078: ID 32ac:0020 Framework Computer Inc LED Matrix Input Module bcdDevice 0.17 ``` +## Developing + +One time setup + +``` +# Install dependencies on Ubuntu +sudo apt install python3 python3-tk + +# Install dependencies on Fedora +sudo dnf install python3 python3-tkinter + +# Create local venv and enter it +python3 -m venv venv +source venv/bin/activate + +# Install package into local env +python3 -m pip install -e . +``` + +Developing + +``` +# In every new shell, source the virtual environment +source venv/bin/activate + +# Launch GUI or commandline +ledmatrixgui +ledmatrixctl + +# Launch Python REPL and import the library +# As example, launch the GUI +> python3 +>>> from inputmodule import cli +>>> cli.main_gui() +```