How to create a new pad in a footprint in KiCad using Python?
To create a new pad in a footprint in KiCad using Python, use the pcbnew module. Here's an example script:

```python
import pcbnew

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

# Find the footprint
footprint_ref = 'U1' # Replace with your footprint reference
footprint = board.FindFootprintByReference(footprint_ref)

# Check if the footprint exists
if footprint:
    # Create a new pad
    new_pad = pcbnew.D_PAD(footprint)
    new_pad.SetShape(pcbnew.PAD_SHAPE_RECT)
    new_pad.SetSize(pcbnew.wxSizeMM(1, 1)) # Size in mm
    new_pad.SetPosition(pcbnew.wxPointMM(5, 5)) # Position in mm
    footprint.Add(new_pad)
    board.Save('path/to/save/your/pcb.kicad_pcb')
else:
    print('Footprint not found')
```

This script creates a new pad in a specified footprint on the current PCB.