I have some modules that I use in a webworker on one page, and in the main page on others. Right now I import either window or self using:
try:
from browser import window as context
except:
from browser import self as context
and then access either as context. But I see that brython is trying (and failing) to load /static/lib/Lib/browser/window.py from my web server once for each module doing this from a webworker, which must be slowing down my loading.
Is there a better, faster way to test whether or not code is running in a webworker?
Thanks!
Ben