How To Write Python Scripts In KiCAD

Article by:
Date Published:
Last Modified:
WARNING
This page is in notes format, and may not be of the same quality as other pages on this site.

Overview

PCB Scripting

The library pcbnew will be automatically available to you when running the script within pcbnew, all you need to do is to import it:

1
2
3
import pcbnew

board = pcbnew.GetBoard()
A screenshot of the Python shell in pcbnew (the KiCAD PCB editor).

A screenshot of the Python shell in pcbnew (the KiCAD PCB editor).

Scripts are placed in <kicad installation dir>/scripting/plugins/. They then show up in pcbnew under Tools > External Plugins.

A directory listing showing all the python plugins that are provided by default with an installation of KiCAD v5.1.6.

A directory listing showing all the python plugins that are provided by default with an installation of KiCAD v5.1.6.


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:

Tags

comments powered by Disqus