This what i'm sort of using.
Fed into the argument is 'ch(“/obj/geo2/carve1/valve”)' or 'ch(“valve”)'
def foo(valveIO) valveCh = hou.hscriptExpression('\'{value}\'') .format(value=valveIO) return valveCh
Testing it in the shell
valveIO = 'ch("/obj/geo2/carve1/valve")' valveCh = hou.hscriptExpression('\'{value}\'') .format(value=valveIO)
returns on print ch(“/obj/geo2/carve1/valve”) rather then the value in that channel.
btw without the “\'” before {value} i'll get a “inline (1): Syntax error in assignment”
Now if I just run hou.hscriptExpression('ch(“/obj/geo2/carve1/valve”)') it does return the correct int value.
Is this something that can't be do in python or am I just going about this wrong?