Hello,
I am trying to scroll text from a text file across a wx.panel.
This is the code so far:
Code:
def scrolling(self, text, rate):
def scroll():
charList = []
dc = wx.ClientDC(self.panel_1)
open_text = open(text, "rb")
my_text = open_text.read()
charList.append(my_text)
open_text.close()
x,y = self.panel_1.GetClientSizeTuple()
while 1:
for z in charList:
for r in range(2000):
dc.DrawText(z,x-r,0)
time.sleep(rate)
dc.Clear()
net3 = threading.Thread(target=scroll)
net3.setDaemon(1)
net3.start()
It scrolls but I am guessing where the range is (2000). I need to be able to determine the total number of pixels that the text in the file is.
Is there a python way to determine this?
Thanks