How to adjust the orientation of a component in KiCad using Python?
To adjust the orientation of a component in KiCad using Python, use the pcbnew module. Here's a script:

```python
import pcbnew

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

# Find the component
component_ref = 'U2' # Replace with your component reference
component = board.FindFootprintByReference(component_ref)

# Check if the component exists
if component:
    # Rotate the component by 45 degrees
    component.Rotate(pcbnew.wxPoint(0,0), 450) # Rotation angle is in tenths of degrees
    board.Save('path/to/save/your/pcb.kicad_pcb')
else:
    print('Component not found')
```

This script rotates a specified component by 45 degrees on the current PCB.