How do I connect two pads with a track using Python scripting in KiCad?
Connecting two pads with a track in KiCad can be done using Python scripting. The script provided shows how to connect pad #1 of footprint 'R1' to pad #1 of 'D1' with a track:

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

def add_track(start, end, layer=pcbnew.F_Cu):
    board = pcbnew.GetBoard()
    track = pcbnew.PCB_TRACK(board)
    track.SetStart(start)
    track.SetEnd(end)
    track.SetWidth(int(0.25 * 1e6))
    track.SetLayer(layer)
    board.Add(track)

board = pcbnew.GetBoard()
start = board.FindFootprintByReference('R1').FindPadByNumber('1').GetCenter()
end = board.FindFootprintByReference('D1').FindPadByNumber('1').GetCenter()
add_track(start, end)

pcbnew.Refresh()
```

This script is useful for creating direct connections between components on a PCB, facilitating efficient circuit design and layout.