Where are the python examples for portenta x8?

You won't be able to control the PWM directly via Python.

You'll need to bind the PWM commands to the RPC library with an Arduino sketch. Then call that RPC binding on the Python side.

The tutorial that johnwasser linked will demonstrate how to do that if you follow step-by-step.

If you don't have any sensors to use with the tutorial, I put together some scripts that just blinks the built-in LED.