I can not run exposed python functions in my js file
Why I can not run exposed python functions in my js file? Hi, I am new to eel and Python, but I found it interesting to try to make a small app via eel, but I encountered a problem with accessing a written python functions in my js file.
I writing in PyCharm and it does not detect /eel.js I think thats might be a problem, but I am not sure

(Html page runs ok)
My file Structure

Code snippet(s)
import eel
from checkmypass import pwned_api_check
eel.init('web')
@eel.expose
def get_password(password):
count = pwned_api_check(password)
if count:
return f'{password} was found {count} times, u probably should change your password'
else:
return f'{password} was Not found'
@eel.expose
def dummy(string):
return string + " hi its eel"
eel.start("index.html", size=(500, 350))
...
Javascript
async function show_result() {
let password = document.getElementById('password').value;
console.log(password);
var res = eel.get_password(password);
console.log(res);
document.getElementById('info').innerText = res;
}
<html>
<head>
<meta charset="UTF-8">
<title>Password Checker</title>
<script type="text/javascript" src="/eel.js"></script>
<script type="text/javascript" src="main.js"></script>
<link rel="icon" type="image/png" href="icon.png">
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Baloo+Tamma+2:wght@500&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<h1>Hello its me, Password checker</h1>
<input id="password" type="text" placeholder="Enter your password" required="">
<button id="show" onclick="show_result()">check</button>
<div id="info"> </div>
</body>
</html>
I understand thats might be a dumb question, but I want to understand why its not working
thank you for reply
Desktop (please complete the following information):
- OS: win10
- Browser: chrome
Hi @letv3 - welcome :) No silly questions.
To your first point about PyCharm saying "eel.js" can't be found - this is "normal". eel.js isn't a file in your system and Eel creates that file and returns it for you when a user hits the /eel.js endpoint.
To the second point, please see https://github.com/samuelhwilliams/Eel#synchronous-returns. I think you should update your code to be: var res = eel.get_password(password)(); - note the important extra () at the end.
Thank You very much, I am sorry for my inattention, have a nice day)
Happy to help! I think we need to make our documentation clearer and easier to read, so it's our fault not yours.
Hope you enjoy Eel. :)