-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrixwetter.py
48 lines (32 loc) · 1 KB
/
matrixwetter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import max7219.led as led
from random import randint
import time
import os
from xml.dom.minidom import *
import urllib
matrix = led.matrix(cascaded = 4)
# matrix = led.matrix()
matrix.brightness(0)
matrix.orientation(90)
#while True:
#Baum = parseString(Baum)
URL = "http://wetter.ringelberger.de/RSS/weewx_rss.xml"
Baum = urllib.urlopen(URL).read()
# Temperatur einlesen
#Temperatur = float(Today.attributes["temp"].value)
temp = Baum.getElementsByTagName('Outside temperature:')[0]
#temp = Temp.attributes["Outside temperature:"].value
print temp
# import subprocess
# temp = subprocess.check_output(["/opt/vc/bin/vcgencmd measure_temp | cut -c6-9"], shell=True)[:-1]
# temp = subprocess.Popen(["/opt/vc/bin/vcgencmd", "measure_temp"], stdout=subprocess.PIPE)
# temp = os.system ('/opt/vc/bin/vcgencmd measure_temp')
# matrix.show_message(str(temp))
# time.sleep(5)
# matrix.clear()
# t = (time.strftime("%d.%m.%Y %H:%M:%S"))
#
# matrix.show_message(str(t))
# time.sleep(2)
# matrix.clear()
# time.sleep(2)