Skip to content

Return Output from Python Scripting Modules in Bonsai #2005

Answered by ncguilbeault
jaroducsb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Yes, you can share variables between python and Bonsai. When you use Get to access a variable inside of python, you can treat the output like a string and transform the output into other data types. For example, if your python variable is convertible to a double, you can use an ExpressionTransform and call Convert.ToDouble(it), which will output a double. I've attached a simple workflow to demonstrate this: python-conversion.zip. For more complex data types, you may want to use a tool like Bonsai.Sgen, or you can check out how we transform python data types in the Bonsai.ML package.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jaroducsb
Comment options

Answer selected by jaroducsb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants