I am just starting to get to grips with a Sense Hat I have recently
bought. (My coding skills are very limited)
I am trying to get it to display local weather using an rss feed.
This is my script
import feedparser
from sense_hat import SenseHat
sense = SenseHat()
d = feedparser.parse("https://weather-broker-cdn.api.bbci.co.uk/en/observation/rss/2643266")
print (d.feed.title)
for post in d.entries:
   print (post.title)
   sense.show_message(post.title)
It works fine but instead of a degree symbol a ? mark is displayed.In answer to my own question
It seems the dgree symbol is missing from the sense hat.
It there anyway to filter the output and either strip the degree symbol
or subtitute it with the word 'degrees'
Dr Stephen Strange wrote:
I am just starting to get to grips with a Sense Hat I have recentlyIn answer to my own question
bought. (My coding skills are very limited)
I am trying to get it to display local weather using an rss feed.
This is my script
import feedparser
from sense_hat import SenseHat
sense = SenseHat()
d =
feedparser.parse("https://weather-broker-cdn.api.bbci.co.uk/en/observation/rss/2643266")
print (d.feed.title)
for post in d.entries:
print (post.title)
sense.show_message(post.title)
It works fine but instead of a degree symbol a ? mark is displayed.
It seems the dgree symbol is missing from the sense hat.
It there anyway to filter the output and either strip the degree
symbol or subtitute it with the word 'degrees'
sense.show_message(post.title.replace("°","'"))
Works
Anssi Saari wrote:
Dr Stephen Strange writes:
sense.show_message(post.title.replace("°","'"))
Works
If it works for you, great. Otherwise you might want to set your locale
so that the degree symbol can actully be printed.
I think the "hat" might have limited character set/bitmap fonts (it's
display is just an 8x8 grid of LEDs
Sysop: | Coz |
---|---|
Location: | Anoka, MN |
Users: | 2 |
Nodes: | 4 (0 / 4) |
Uptime: | 140:29:00 |
Calls: | 166 |
Files: | 5,389 |
Messages: | 223,239 |