one further hint. If you have a first overview to Python you can have a look to the example scripts on XMC (see in "Tasks->Scripts). There are some easy and some more complex scripts.
With these scripts you will see how python works with XMC and the switches.