简体   繁体   English

我可以从 JavaScript 到 Python 获取数据吗?

[英]Can I get data from JavaScript to Python?

There is a module that's only available for JS, but my project is written in Python and it will be impossible to transfer it to JS at this point.有一个模块只适用于 JS,但我的项目是用 Python 编写的,此时无法将其转移到 JS。 Is there a way to transfer the data from JS without setting up a server?有没有办法在不设置服务器的情况下从 JS 传输数据?

The short answer is no .简短的回答是否定的。 Python and JavaScript may work together by implementing frameworks like Flask and Django , but to set up those you do need a server. Python and JavaScript may work together by implementing frameworks like Flask and Django , but to set up those you do need a server.

You may however set up a Node.js installation on your local machine and then having it start your Python script, with arguments being the product of your JS function, by following this example. You may however set up a Node.js installation on your local machine and then having it start your Python script, with arguments being the product of your JS function, by following this example.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM