How can I adjust the positions of components on my PCB using Python in KiCad?
Adjusting the positions of components on a PCB can be done programmatically using Python in KiCad. The following script finds specific components by their references and repositions them on the board:

```python
import pcbnew
from pcbnew import wxPoint, wxPointMM

# Get reference to footprint objects
board = pcbnew.GetBoard()
r1 = board.FindFootprintByReference('R1')
r2 = board.FindFootprintByReference('R2')
d1 = board.FindFootprintByReference('D1')
assert(r1 and r2 and d1)

# Place footprints
r1.SetPosition(wxPointMM(20, 20))    # Position R1
r2.SetPosition(wxPointMM(25, 21))    # Position R2
d1.SetPosition(wxPointMM(23, 26))    # Position D1

# Update display
pcbnew.Refresh()
```

This script relocates the 'R1', 'R2', and 'D1' components to new positions on the PCB, showcasing how to automate layout adjustments.