30 lines
662 B
Python
30 lines
662 B
Python
|
from weather import Weather
|
||
|
import datetime as d
|
||
|
weather = Weather()
|
||
|
|
||
|
weatherWro = weather.lookup_by_location("Wroclaw")
|
||
|
print(weatherWro.condition().text())
|
||
|
|
||
|
def fc_conv (f):
|
||
|
res = round((float(f) - 32) / 1.8, 2)
|
||
|
return res
|
||
|
|
||
|
|
||
|
print(fc_conv(1))
|
||
|
|
||
|
|
||
|
fcst = weatherWro.forecast()
|
||
|
temp=[]
|
||
|
day=[]
|
||
|
for i in fcst:
|
||
|
day.append(i.date())
|
||
|
temp.append(i.low())
|
||
|
dayMin = day[temp.index(min(temp))]
|
||
|
dayMin2 = d.datetime.strptime(dayMin, '%d %b %Y')
|
||
|
dayTxt = (dayMin2.weekday())
|
||
|
daysPl = ["Poniedzialek", "Wtorek", "Sroda", "Czwartek", "Piatek", "Sobota", "Niedziela"]
|
||
|
#print(dayMin)
|
||
|
print(daysPl[dayTxt])
|
||
|
print(fc_conv(min(temp)))
|
||
|
|