Update nvim, zsh

This commit is contained in:
Smirnov Alexandr 2021-03-09 12:32:35 +02:00
parent 4400d0aac8
commit a9d8ac7432
5 changed files with 47 additions and 63 deletions

View file

@ -1,15 +1,8 @@
"""For working this script set in ~/.profile 2 variable:
OWM_POLYBAR: API key
OWM_CITY: Your city
"""
import requests, os
API_KEY = os.getenv("OWM_POLYBAR")
CITY = os.getenv("OWM_CITY")
try:
JSON = requests.get(f"http://api.openweathermap.org/data/2.5/weather?q={CITY}&lang=EN&&units=metric&appid={API_KEY}").json()
print("", int(JSON["main"]["temp"]), "°С")
except Exception:
print(" err °С")
except Exception as e:
print(" err")