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
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.
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: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 175:10:59 |
Calls: | 7,915 |
Files: | 12,983 |
Messages: | 5,797,729 |