Houdini 12 Python Scripting with the Houdini Object Model hou

This feature is not yet documented

Methods

addCloseCallbackRegister a Python callback to be called whenever the last Houdini Python Shell is closed.
addDataForReading
addEOFForReading
closeCallbacksReturn a tuple of all the Python callbacks that have been registered with hou.ShellIO.addCloseCallback.
getAndClearWrittenData
interruptShellThread
isWaitingForCommand
isattyImplemented as part of the “file-like object” interface.
readline
removeCloseCallbackRemove a Python callback that was previously registered with hou.ShellIO.addCloseCallback. See hou.ShellIO.addCloseCallback for more information.
setIsWaitingForCommand
write
addDataForReading(self, data)

This feature is not yet documented

addEOFForReading(self)

This feature is not yet documented

addCloseCallback(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().addCloseCallback(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.

closeCallbacks() tuple of callback

Return a tuple of all the Python callbacks that have been registered with hou.ShellIO.addCloseCallback.

getAndClearWrittenData(self) → string

This feature is not yet documented

interruptShellThread(self)

This feature is not yet documented

isatty(self) bool

Implemented as part of the “file-like object” interface.

isWaitingForCommand(self) → bool

This feature is not yet documented

readline(self, size=-1) → string

This feature is not yet documented

removeCloseCallback(callback)

Remove a Python callback that was previously registered with hou.ShellIO.addCloseCallback. See hou.ShellIO.addCloseCallback for more information.

Raises hou.OperationFailed if the callback was not previously registered.

setIsWaitingForCommand(self, on)

This feature is not yet documented

write(self, data)

This feature is not yet documented