How to use the eel.set_state_box_value function in Eel

To help you get started, we’ve selected a few Eel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ChrisKnott / Algojammer / state_boxes.py View on Github external
try:
            if code.startswith('#draw'):
                # Add drawing functions to snapshot scope
                for f in 'ink line circ rect font text'.split():
                    snapshot_copy[f] = eval('drw.' + f)
                drw.start()
                exec(code, snapshot_copy)
                value = drw.end()
            else:
                data['print'] = ''
                exec(code, snapshot_copy)
                value = htm.escape(data['print'])
        except Exception as e:
            value = htm.escape(repr(e))

        eel.set_state_box_value(uid, value)