hou.ShellIO
class
Methods
addDataForReading(self, data)addEOFForReading(self)addExitCallback(callback)-
Register a Python callback to be called whenever the last Houdini Python Shell is closed.
callback
Any callable Python object that expects no parameters. It could be a Python function, a bound method, or any object implementing __call__.
def cleanup(): # Here is where you would run your cleanup code when # the Python shell has closed. pass hou.ui.shellIO().addExitCallback(cleanup)
You might use this function to cleanly terminate any mechanisms that are dependent on the Python shell. For example, you can register a callback which disables an object from logging output messages to the shell.
exitCallbacks()→tupleof callback-
Return a tuple of all the Python callbacks that have been registered with hou.ShellIO.addExitCallback.
getAndClearWrittenData(self)→ stringinterruptShellThread(self)isatty(self)→bool-
Implemented as part of the “file-like object” interface.
isWaitingForCommand(self)→ boolreadline(self, size=-1)→ stringremoveExitCallback(callback)-
Remove a Python callback that was previously registered with hou.ShellIO.addExitCallback. See hou.ShellIO.addExitCallback for more information.
Raises hou.OperationFailed if the callback was not previously registered.
setIsWaitingForCommand(self, on)write(self, data)