How to instruct Mindstorms EV3 from PC conditionally?
If you are running ev3dev on the EV3, you can use RPyC to remotely execute Python code on the EV3.

Resources:


Python-ev3dev. Working with ev3dev remotely using RPyC
EV3 PYthon. RPyC