Everythink was going fine, but when I finish my code and tried to run then I got this error, what do you think what could happen. I use Linux Mint. The problem is with EEL module I think, when I run html code and go to console I can see
GET file:///eel.js net::ERR_FILE_NOT_FOUND
I have been solving the problem already 3-4 days, but I could not find the answer. I hope you will help me with this.
Python code:
import eel
import pyowm
own = pyowm.OWM('d845c8640738fe82515cb1277bb3dd38')
eel.init('web')
eel.start('main.html', size=(700, 700))
@eel.expose
def get_weather(city):
mgr = own.weather_manager()
observation = mgr.weather_at_place(city)
w = observation.weather
temp = w.temperature('celsius')['temp']
return city + ' ' + str(temp)
And html/js code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Weather</title>
<script type="text/javascript" src="/eel.js"></script>
<link rel="stylesheet" type="image/png" href="weather-icon.png">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<input id="location" type="text" placeholder="Write the name of your Country ot City" required="" value="Bukhara, Uzbekistan">
<button id ="show">Know the weather</button>
<div id="info">
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
async function display_weather(){
let place = document.getElementById('location').value;
let res = await eel.get_weather(place)();
document.getElementById('info').innerHTML = res;
}
jQuery('#show').on('click', function(){
display_weather();
});
</script>
</body>
</html>
Before I asked and indicated only second error whick I saw in the browser's console, unfortunately I can not find the asnwer. Thanks