尝试加载eel.js时出现文件未找到错误

时间:2019-06-30 10:29:40

标签: python html python-3.x eel

我目前正在使用eel在html / python中编写一个简单的GUI。不幸的是,尽管直接从官方教程中复制了它,但是当我尝试加载eel.js时,却收到错误消息“ GET file:/// C:/eel.js net :: ERR_FILE_NOT_FOUND”。我的标题看起来像这样:

C#

谢谢您的帮助。

我的python文件看起来像这样:

<head>
    <meta charset="utf-8">
    <title>My eel GUI</title>
    <script type="text/javascript" src="/eel.js"></script>
    <script>
        eel.expose(my_function)
        function my_function(text) {
            console.log("Hello!")
        }
    </script>
</head>

1 个答案:

答案 0 :(得分:0)

在您的 init 函数顶部添加@ eel.expose。像这样:

TIME_ZONE = "Europe/Zurich"
相关问题