1

Sorry for my English. I am want to study python library (eel). I am wrote the following code as in the example from the documentation: The "index.html" file is located in the "Web" folder:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello</title>
    <script type="text/javascript" src="/eel.js"></script>
    <script type="text/javascript">
        eel.python_func("Hello from Python");
    </script>
</head>
<body>
    Hello!!
</body>
</html>

The "main.py" file is located one level above the "index.html" file:

import eel

eel.init("web")

@eel.expose
def python_func(text):
    print(text)

eel.start("index.html")

Running main.py displays a browser window that says "Hello !!" but python_func() dont started. Message "Hello from Python" dont displayed in terminal. I am tried different options for solutions to problem:

  • reinstalled eel
  • reinstalled python
  • pasted the python_func () function code right after import. But this solutions not helped.

I ask for help in solving my problem. I am using Python 3.7.6 32 bit

Aevgenyev
  • 11
  • 1
  • Is this still an issue for you? I copied and pasted your code into an example eel project, and it worked without any modifications. I'm running on Windows 10, Python 3.9.2, using Eel 0.14.0... maybe one of those differences allows me to run? – dstricks Jul 30 '21 at 21:21

0 Answers0