-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Every code block runs in its own scope currently, so if i have multiple code blocks on a single page i have to redefine everything above. So:
def hello():
print('Hello')
Then:
hello()
will not work.
I understand this is by design (brython-dev/brython#690) but for documents we should enable global namespace.
I patched this in brython_runner.py
window.__BRYTHON__.user_namespace = {}
ns = window.__BRYTHON__.user_namespace
before def run().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels