Transcrypt is Ok. It compiles a Python-like language to JavaScript - which requires a subset of Python that can be fully compiled. At a sprint someone explored using it for adventurelib on the web and mostly got it working, after a few code tweaks.
Alternatively there's Brython, which is a full Python 3.7 implemented in JavaScript. That's much more compatible; most of the CPython standard library works out of the box.
There's also Batavia which takes the same approach as Brython but doesn't include a parser/compiler client-side, so may start up faster.
mauve on 2019/08/20 06:32:
Transcrypt is Ok. It compiles a Python-like language to JavaScript - which requires a subset of Python that can be fully compiled. At a sprint someone explored using it for adventurelib on the web and mostly got it working, after a few code tweaks.
Alternatively there's Brython, which is a full Python 3.7 implemented in JavaScript. That's much more compatible; most of the CPython standard library works out of the box.
There's also Batavia which takes the same approach as Brython but doesn't include a parser/compiler client-side, so may start up faster.