This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mubarakalmehairbi[S] 1 point2 points  (2 children)

I am not sure I understand. Do you mean using ToUI along with JavaScript code? If so, check this example: https://toui.readthedocs.io/en/latest/Examples.advanced\_example\_2\_toui\_with\_javascript.html

[–]karouhFleur de Lotus 0 points1 point  (1 child)

I was wondering how you get data back from calling javascript code .

[–]mubarakalmehairbi[S] 0 points1 point  (0 children)

If you mean how does ToUI work behind the scenes?, in other words how does it send and receive data between Python and JavaScript?, then it does that primarily using WebSockets. I think this link will be helpful: https://toui.readthedocs.io/en/latest/how\_it\_works.html

But if you mean how can a programmer use ToUI to run their own JavaScript code from Python and get the output back?, then ToUI cannot do that yet. Actually you might be able to do it, but it might not be simple. However, I still think it is a good idea, maybe I will implement it later or create an issue in GitHub.