hscriptStringExpression(expression)
→ string
This function will force the return type to be a string. If the expression does not evaluate to a string, this function returns its string representation.
Most of the time, you want to use hou.hscriptExpression() over this function. See it for more examples.
Raises hou.OperationFailed if the expression is invalid or generates an error occur during evaluation.
>>> hou.hscriptStringExpression("3") '3' >>> hou.hscriptStringExpression('"3"') '3' >>> hou.hscriptStringExpression("$F") '1' >>> hou.hscriptStringExpression('vector("[1, 2, 3]")') '[1,2,3]'
See also |