How to change the layer of a footprint in KiCad using Python?
To change the layer of a footprint in KiCad using Python, you can use the pcbnew module. Here's a script:

```python
import pcbnew

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

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

# Check if the footprint exists
if footprint:
    # Change the footprint to the bottom layer
    footprint.SetLayer(pcbnew.B_Cu)
    board.Save('path/to/save/your/pcb.kicad_pcb')
else:
    print('Footprint not found')
```

This script changes the layer of a specified footprint to the bottom layer on the current PCB.