I have the below script and wanted to know how I can make this just a static image without the scrolling.
from samplebase import SampleBase
from rgbmatrix import graphics
import time
import requests
from bs4 import BeautifulSoup as bs
class RunText(SampleBase):
def run(self):
while True:
res = requests.get('https://www.marketwatch.com/investing/stock/gme')
soup = bs(res.content, 'lxml')
price = soup.select_one('.intraday__price .value').text
res1 = requests.get('https://www.marketwatch.com/investing/stock/etsy')
soup1 = bs(res1.content, 'lxml')
price1 = soup1.select_one('.intraday__price .value').text
res2 = requests.get('https://www.marketwatch.com/investing/stock/aapl')
soup2 = bs(res2.content, 'lxml')
price2 = soup2.select_one('.intraday__price .value').text
offscreen_canvas = self.matrix.CreateFrameCanvas()
font = graphics.Font()
font.LoadFont("../../../fonts/6x10.bdf")
textColor = graphics.Color(255, 255, 0)
stock2 = graphics.Color(139, 0, 0)
stock3 = graphics.Color(64, 0, 255)
pos = offscreen_canvas.width
my_text = " GME: " + price
my_text1 = "ETSY: " + price1
my_text2 = "AAPL: " + price2
while True:
offscreen_canvas.Clear()
len = graphics.DrawText(offscreen_canvas, font, pos, 10, textColor, my_text)
len2 = graphics.DrawText(offscreen_canvas, font, pos, 18, stock2, my_text1)
len3 = graphics.DrawText(offscreen_canvas, font, pos, 26, stock3, my_text2)
pos -= 1
if (pos + len3 < 0):
pos = offscreen_canvas.width
break
time.sleep(0.08)
offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)
#Main function
if __name__ == "__main__":
run_text = RunText()
time.sleep(0.08)
if (not run_text.process()):
run_text.print_help()