Best way to integrate Python and JavaScript?

后端 未结 12 2464
礼貌的吻别
礼貌的吻别 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:54

    PyExecJS is able to use each of PyV8, Node, JavaScriptCore, SpiderMonkey, JScript.

    >>> import execjs
    >>> execjs.eval("'red yellow blue'.split(' ')")
    ['red', 'yellow', 'blue']
    >>> execjs.get().name
    'Node.js (V8)'
    

提交回复
热议问题