Я пытаюсь вызвать функцию python через мою программу js, и у меня возникает ошибка:
eel.say_hello_py is not a function
Я просто пробовал шаг за шагом их документы, но не работает , не знаю почему, что мне не хватает?
моя python программа содержит:
import eel
eel.init('web')
eel.start('index.html', mode='chrome-app')
@eel.expose # Expose this function to Javascript
def say_hello_py(x):
print('Hello from %s' % x)
моя html содержит:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="index.css">
<title>Document</title> </head>
<body>
<script type="text/javascript" src="/eel.js"></script>
<script src="index.js" type="text/javascript"></script> </body>
</html>
мой индекс . js файл содержит:
eel.say_hello_py("Javascript World!"); // Call a Python function
конструкция моих файлов:
web(folder)
-> index.html
-> index.js
python.py
что мне не хватает?