简体   繁体   English

无法使用 eel 从 javascript 运行 python 脚本

[英]cant run a python script from javascript using eel

so for a good time i was searching for a way to run a python script directly from JavaScript and that was when I found something called eel which is supposed to do that so I followed what the documentation is saying and everything looks right, I hit a button in that I built with html in which after I click this button the python script runs, but I keep getting and error in my browser console saying that eel is not defined.所以我一直在寻找一种直接从 JavaScript 运行 python 脚本的方法,那时我发现了一种叫做 eel 的东西,它应该这样做,所以我按照文档所说的,一切看起来都正确,我点击了我使用 html 构建的按钮,在我单击此按钮后,python 脚本运行,但我的浏览器控制台中不断出现错误,提示未定义 eel。

note that i included this line in html as the documentation suggests: <script type=”text/javascript” src=”/eel.js”></script>请注意,正如文档所示,我在 html 中包含了这一行: <script type=”text/javascript” src=”/eel.js”></script>

no idea what is wrong hope someone can help.不知道出了什么问题希望有人可以提供帮助。 thanks in advance提前致谢

To my google search, thats not what eel does.在我的谷歌搜索中,这不是鳗鱼的作用。 Its job to be used is a Electron-like tool for python, NOT to make web apps have python in them.它的工作是用于 python 的类电子工具,而不是让 web 应用程序中包含 python。 if you want python in a browser try making a web app in flask or look into Pyodide如果您想在浏览器中使用 python 尝试在 flask 中创建 web 应用程序或查看Pyodide

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

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