Что бы я не вводил, показывает одну и ту же погоду, что не так?

WILGRAND

Новичок
Пользователь
Апр 20, 2022
1
0
1
Windows 11
Python 3.10
Package Version
------------------------- ---------
altgraph 0.17.2
certifi 2021.10.8
charset-normalizer 2.0.12
colorama 0.4.4
future 0.18.2
geojson 2.5.0
idna 3.3
pefile 2021.9.3
pip 22.0.4
pyinstaller 5.0
pyinstaller-hooks-contrib 2022.4
pyowm 3.3.0
PySocks 1.7.1
pywin32-ctypes 0.2.0
requests 2.27.1
setuptools 58.1.0
urllib3 1.26.9


Код:
Python:
#Тупая погода

from pyowm import OWM
from pyowm.utils import config
from pyowm.utils import timestamps
from pyowm.utils.config import get_default_config
config_dict = get_default_config()
config_dict['language'] = 'ru'

owm = OWM('955062b2e372c4c4aef8f2d1984f6da3')
mgr = owm.weather_manager()

place = input ( "Введите ваш город: " )
observation = mgr.weather_at_place('place')
w = observation.weather
temp = w.temperature('celsius')['temp']

print ("Сейчас в городе " + place + ": " + w.detailed_status + ", " + str(temp) + "℃" )
input ()
 

Vershitel_sudeb

Vershitel sudeb
Команда форума
Модератор
Мар 17, 2021
933
208
43
20
Москва
observation = mgr.weather_at_place('place')
Кавычки не нужны, ты должен передать название города, а не слово 'place'
 

Форум IT Специалистов