您好,我正在尝试运行一个py函数,但给我两个错误,我不知道该做什么,谁能帮助我吗,请。
错误1:匿名net::ERR_ABORTED 404 (未找到)错误2:未捕获ReferenceError:未在hello.html:6 (匿名)@ hello.html:6定义eel
文件夹:https://i.stack.imgur.com/aeQFS.png
HTML:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="eel.js"></script>
<script type="text/javascript">
eel.hello("hiiii");
</script>
</head>
<body>
</body>
</html>PYTHON:
import eel
eel.init('web')
eel.start('hello.html', size=(300, 200))
@eel.expose
def hello(x):
print('Hello from %s' % x)
f = open("myfile.txt", "x")发布于 2021-07-27 07:56:06
尝试将eel.start('hello.html', size=(300, 200))移到Python文件的底部。应该在调用eel.start(<args>)之前公开hello函数。
如下所示:
import eel
eel.init('web')
@eel.expose
def hello(x):
print('Hello from %s' % x)
eel.start('hello.html', size=(300, 200))https://stackoverflow.com/questions/68407045
复制相似问题