new bluetooth script
[dotfiles_afify.git] / .scripts / bar_scripts / unused / weather.py
blob55867d03391b730be790261fada15a0c4f2b5b86
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 import pyowm
5 symbol_celsius = "˚C"
7 def get_temp():
9 owm = pyowm.OWM("8c59eae6498ac60139316ea4e2c9a82b")
10 observation = owm.weather_at_place('Mecca, SA')
11 w = observation.get_weather()
12 temp = w.get_temperature("celsius")
13 print(str(temp["temp"]) + symbol_celsius)
15 try:
16 get_temp()
17 # create a file store last temp
19 except:
20 # raise
21 # show the last temp
22 print("--" + symbol_celsius)
23 # get_temp()