Add starship, update vscode

This commit is contained in:
Smirnov Alexander 2021-04-11 10:56:24 +03:00
parent a4eeb45201
commit e268665220
12 changed files with 96 additions and 103 deletions

View file

@ -1,11 +1,15 @@
import requests, os
import requests
import 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 as e:
print(" err")
except Exception:
print(" err")