oTree Forum >

Pass Json data to Python

#1 by Fanist

Hi everyone,

Can I get some snippets or tutorials about passing json data in javascript within HTML page to python? I got to know the function js_vars(), but I hope a function works reversely. Thanks´╝ü

#2 by gmdcastillo

You have to send you JSON using the liveSend method in javascript, then on the python side you can use the json module https://docs.python.org/3/library/json.html with json.loads

Write a reply

Set forum username