Best way to integrate Python and JavaScript?

后端 未结 12 2428
礼貌的吻别
礼貌的吻别 2020-11-28 02:39

Is it possible to integrate Python and JavaScript? For example, imagine you wanted to be able to define classes in JavaScript and use them from Python (or vice versa). If

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 02:57

    there are two projects that allow an "obvious" transition between python objects and javascript objects, with "obvious" translations from int or float to Number and str or unicode to String: PyV8 and, as one writer has already mentioned: python-spidermonkey.

    there are actually two implementations of pyv8 - the original experiment was by sebastien louisel, and the second one (in active development) is by flier liu.

    my interest in these projects has been to link them to pyjamas, a python-to-javascript compiler, to create a JIT python accelerator.

    so there is plenty out there - it just depends what you want to do.

提交回复
热议问题