There is a Python interpreter in naclports (to run as Google Chrome Native Client App).

Are there any examples for bundling the interpreter with a custom Python application and how to integrate this application with a HTML page?

有帮助吗?

解决方案

The interpreter is currently the only python example in naclports. However, it should be possible to link libpython into any nacl binary, and use it just as you would embed python in any other C/C++ application. A couple of caveats: you must initialize nacl_io before making any python calls, and as you should not make python calls on the main (PPAPI) thread.

In terms of interacting with the HTML page, as with all NaCl applications this must be done by sending messages back and forth between native and javascript code using PostMessage(). There is no way to directly access the HTML or JavaScript from native code.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top