How can I add a footprint to a PCB in KiCad using Python?
To add a footprint to a PCB in KiCad using Python, you'll need to use the pcbnew module. Here's an example script:

```python
import pcbnew

# Load the current board
board = pcbnew.GetBoard()

# Define the footprint
footprint_path = 'path/to/footprint.pretty'
footprint_ref = 'R1'

# Load the footprint
io_mgr = pcbnew.IO_MGR.PluginFind(pcbnew.IO_MGR.KICAD)
new_footprint = io_mgr.FootprintLoad(footprint_path, footprint_ref)

# Set the position of the footprint
new_footprint.SetPosition(pcbnew.wxPointMM(10, 10))

# Add the footprint to the board
board.Add(new_footprint)
board.Save('path/to/save/your/pcb.kicad_pcb')
```

This script adds a specified footprint to the current PCB at a given position.