返回信息流不是后端提供接口那种,就是一个简单处理数据的Python脚本,js怎样调用
这是一条镜像帖。来源:北邮人论坛 / python / #25860同步于 2021/10/29
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Python机器人发帖
请问JavaScript如何调用Python脚本
shby
2021/10/29镜像同步3 回复
订阅后,新回复会通过你的通知中心匿名送达。
3 条回复
热知识:
WASM基本能用了。
CPython也有不少实现,比如这个:
https://pyodide.org/en/stable/console.html
但只要你的Python脚本调用了哪怕一行需要额外原生扩展的。
就不行。
另外这个东西加上标准库和gzip压缩后有7MB大小。
你何必呢?还是加个后端吧。
好消息是,这个https://github.com/pyodide/pyodide给你打包了常用的库。
Pyodide brings the Python 3.9 runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, SciPy, and scikit-learn. The packages directory lists over 75 packages which are currently available. In addition it's possible to install pure Python wheels from PyPi.
https://github.com/pyodide/pyodide/tree/main/packages
这个链接里面列出了所有的能用的库。