### Run Example Script Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/README.md Execute an example script to verify the installation and connection to KiCad. This script prints the connected KiCad version. ```shell $ python3 ./examples/hello.py ``` -------------------------------- ### Headless Mode Example Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/README.md Run a script that starts KiCad in headless mode using `kicad-cli api-server`. This script provides a Python REPL environment for interacting with KiCad files without a GUI. ```shell ./examples/headless.py ``` -------------------------------- ### Set Up Virtual Environment and Install Dependencies Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/COMPILING.md Manually create a Python virtual environment, activate it, and then install Poetry and other development tools. This option is for users who prefer managing environments outside of Poetry. ```sh $ python3 -m venv .env $ . .env/bin/activate $ python3 -m pip install --upgrade pip $ python3 -m pip install poetry pre-commit $ poetry install ``` -------------------------------- ### Build and Install Library Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/COMPILING.md Build the kicad-python library and install it in the current Python environment. This step is performed after dependencies are installed. ```sh $ poetry build $ poetry run pip install -e . ``` -------------------------------- ### Run Example Script Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/COMPILING.md Execute an example Python script using Poetry. Ensure KiCad is running with the API server enabled for this to work correctly. ```sh $ poetry run python examples/hello.py ``` -------------------------------- ### Install Poetry and Dependencies Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/COMPILING.md Install Poetry globally and then use it to install the project's Python dependencies. This is the recommended approach for development. ```sh $ uv tool install poetry # Or whatever other way you want to install Poetry $ poetry install ``` -------------------------------- ### Run KiCad Plugin Example Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/examples/README.md Execute a KiCad plugin script directly from the terminal. Ensure the script is located within the appropriate directory structure. ```bash python3 round_tracks/round_tracks_action.py ``` -------------------------------- ### Fix KiCad.run_action Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/README.md This commit addresses an issue with the `KiCad.run_action` function. ```python KiCad.run_action (leommxj) ``` -------------------------------- ### Run Standalone Python Script Source: https://gitlab.com/kicad/code/kicad-python/-/blob/main/examples/README.md Execute a simple Python script directly from the terminal. ```bash python3 hello.py ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.