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: | Weed Hopper |
---|---|
Location: | Clearwater, FL |
Users: | 14 |
Nodes: | 6 (0 / 6) |
Uptime: | 231:42:22 |
Calls: | 55 |
Calls today: | 1 |
Files: | 50,127 |
D/L today: |
34 files (4,425K bytes) |
Messages: | 275,362 |