Пoгoда html python ошибки
Решил повторить создание погоды но получилось что-то не так
<html>
<head>
<meta charset="UTF-8">
<title>Пагода</title>
<script src="eel.js"></script>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" href="style.css">
</head>
<input id="location" type="text" placeholder="Город\Страна" required="">
<body>
<button id="now"> Узнать </button>
<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()
}
>
</body>
</html>```
PYTHON
```import eel
import pyowm
owm = pyowm.OWM("СКРЫТО")
@eel.expose
def get_weather(place):
pass
place = input("Город\Страна :")
mgr = owm.weather_manager()
observation = mgr.weather_at_place(place)
w = observation.weather
t = w.temperature("celsius")
t1 = t["temp"]
t2 = t["feels_like"]
return "в городе/стране, {place} температура {t1} ,ощущение {t2}"
eel.init("web")
eel.start("index.html", size = (200, 250))```
Могу еще CSS приложить
Ответы (1 шт):
Автор решения: Prince D
→ Ссылка
import eel
import pyowm
owm = pyowm.OWM("СКРЫТО")
@eel.expose
def get_weather(place):
mgr = owm.weather_manager()
observation = mgr.weather_at_place(place)
w = observation.weather
t = w.temperature("celsius")
t1 = t["temp"]
t2 = t["feels_like"]
return f"в городе/стране, {place} температура {t1} ,ощущение {t2}"
eel.init("web")
eel.start("index.html", size = (200, 250))