Python : How can I send command lines to a (silent) running shell program

69 Views Asked by At

I work with python in Houdini, but bear with me as my question might not be only restricted to the Houdini environment.

Basically, Houdini comes with a "Hython" process that is supposed to be a Python shell (see the end of this doc : https://www.sidefx.com/docs/houdini/hom/commandline.html)

At some point, Houdini can start multiple of these "hython.exe" without the shell interface, they are automatically managed in background using a server that dispatch instructions to them. There is no explicit way to directly communicate with them using the API, but I want to be able to do exactly this. Is there a way to send command lines to a running process (that is supposed to support them) ?

Very long shot part of my question : I'm trying to communicate with the hython processes as the server never tells them to flush their cache when a full set of computation has finished; leading to inflated memory consumption after a while and the need to stop/restart new hythons. It's already admitted by SideFx there is nothing in the API to ask for a cache flush (see here : https://www.sidefx.com/forum/topic/81712/)

I tried to embedd some naive "clear output" in the nodes processes I send to the hythons, to no avail. "Unload" tag on nodes does nothing. Node deletion doesn't understand context and will delete my project nodes before they are sent to a hython.

0

There are 0 best solutions below