Controlling nodes through TCP/IP

Hi

I’m working on a project that i need to control through inputs sent from a python script through TCP/IP to TouchDesigner.

Currently i’ve managed to set it up, so TD receives messages from my script in the TCPIP node/module.

How can i make TD “React” on these messages? I want to activate a series of different videoclips by voice command, but i’m struggling with figuring out how to set that up in touchdesigner.
I suppose i have to write the command into the TCPIP_callbacks window, but i can’t find the proper documentation to do so.

Anyone has an idea, or maybe a project that similarly is controlled through TCP/IP messages that i can look into?

Thanks

You can use the python eval() function to have arbitrary strings you send across the network run in the receiving file. This is of course a large security risk if there is any chance anyone else can connect to your TCPIP socket since they can run any code they want on the system.
A safer solution is to decide on a subset of commands, parse the TCPIP message and call a specific function that handles each of the commands you deem legal.

Thanks!

I managed to achieve what i wanted