request1 = f"""<typ:simple>
<typ:attributeName>Session_Id</typ:attributeName>
<typ:value>{}</typ:value>
</typ:simple>"""
....
response1 = requests.post(url,data=request1.format(uuid.uuid4()).encode('utf-8'),headers=headers)
import eel
import pyowm
owm=pyowm.OWM("11c0bcbf5628a90aa946468e636fb932")
@eel.expose
def get_weather(city):
mgr=owm.weather_manager()
observation=mgr.weather_at_place(city)
w=observation.weather
temp=w.temperature('celsius')['temp']
return "в городе "+ city + " сейчас "+ str(temp) + " градусов "
eel.init('web')
eel.start('main.html')
<!DOCTYPE html>
<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" type="text/css" href="main.css">
</head>
<body>
<input id="location" type="text" placeholder="Введите название страны и города" required="" value="london">
<button id="show">Узнать погоду</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>