Not out of the box on the ThingWorx Instance, it supports Server Side Javascript, Java and SQL (if it's a Remote BDD Thing).
"Workarounds", just thinking loud:
- You can do an extension in Java which triggers the desired Python code.
- You can do a Remote Thing which Implements ThingWorx Edge SDK and executes your Python Code -> Actually the Edge Microserver can execute LuaScript for instance. And you have Edge SDK for C, Dot.net and Java.
Just my two cents,
Carles.