rage / python-kesa20

https://python-k20.mooc.fi
0 stars 7 forks source link

Code States Visualizer #2

Closed nygrenh closed 4 years ago

nygrenh commented 4 years ago

This should work.

<code-states-visualizer input='{"code": "print(\"Hello\")\na = 1\nb = 2\nprint(a)\nprint(\"b\")", "trace": [{"line": 1, "event": "step_line", "func_name": "<module>", "globals": {}, "ordered_globals": [], "stack_to_render": [], "heap": {}, "stdout": ""}, {"line": 2, "event": "step_line", "func_name": "<module>", "globals": {}, "ordered_globals": [], "stack_to_render": [], "heap": {}, "stdout": "Hello\n"}, {"line": 3, "event": "step_line", "func_name": "<module>", "globals": {"a": 1}, "ordered_globals": ["a"], "stack_to_render": [], "heap": {}, "stdout": "Hello\n"}, {"line": 4, "event": "step_line", "func_name": "<module>", "globals": {"a": 1, "b": 2}, "ordered_globals": ["a", "b"], "stack_to_render": [], "heap": {}, "stdout": "Hello\n"}, {"line": 5, "event": "step_line", "func_name": "<module>", "globals": {"a": 1, "b": 2}, "ordered_globals": ["a", "b"], "stack_to_render": [], "heap": {}, "stdout": "Hello\n1\n"}, {"line": 5, "event": "return", "func_name": "<module>", "globals": {"a": 1, "b": 2}, "ordered_globals": ["a", "b"], "stack_to_render": [], "heap": {}, "stdout": "Hello\n1\nb\n"}]}'></code-states-visualizer>
Redande commented 4 years ago

This works as of b55fbbfc2faa13587a514f5e0dc79dcc3a4cf4e0