How can I adjust the solder paste margin for specific module pads in KiCad using Python?
Adjusting the solder paste margin for specific module pads in KiCad can be achieved using Python scripting. The script provided demonstrates this by locating module U304 and iterating over its pads to set the solder paste margin. It prints the existing margin for each pad and then sets the margin to 0 for all but pad 15:

```python
#!/usr/bin/env python2.7
import sys
from pcbnew import *

filename=sys.argv[1]
pcb = LoadBoard(filename)

# Find and process pads of module U304
u304 = pcb.FindModuleByReference('U304')
pads = u304.Pads()
for p in pads:
    print p.GetPadName(), ToMM(p.GetLocalSolderPasteMargin())
    id = int(p.GetPadName())
    if id<15: p.SetLocalSolderPasteMargin(0)

pcb.Save("mod_"+filename)
```

This script is useful for customizing solder paste application, particularly in complex PCB designs where specific pads require different solder paste settings.