Originally Posted by J Dihzy
Could you be a bit more specific?
data = 0
if data != incoming_data:
data = incoming_data
Sumthing like that doesn't work?
Two pc's are connected with RS 232 label for serial communication. one pc for transmitting and other pc for receiving.
I will run this code in receiving pc.
This code is to receive text from a transmitting pc and display it on tkinter window of the receiving pc.
The received text has to be displayed on tk window Until it receives other text from transmiting pc.
But With my code the contents of the received text is displaying on tk window for only few milliseconds, then after tk window looks plain with no contents of data. When it receives another text from transmitter, it again displays the text only for milliseconds and the text vanishes.
The text is not a pre defined bunch of messages of equal lengh, the length of the text vary all the time.
The time period between the text's is not constant, it also vary all the time.
The transmitter sends text at differnet time periods,first text in 5 min, next text may be in 10 min and the third text may be in 30 min and so on. I don't want to clear the contents of the text from the tk window until it receives other text from transmitter.
The font size i choose is 37 and I dont need a scrool bar to scrool the window, because transmitter sends maximum of 5 lines to display on receiver tk widow.
THE DATA WHICH IS DISPLAYING ON TKINTER WINDOW SHOULD KEEP ON DISPLAYING UNTIL IT RECEIVES DATA AGAIN FROM TRANSMITTER.
import Tkinter as tk
def __init__(self, queue):
self.queue = queue
s = serial.Serial('COM10',9600)
text = s.readline(s.inWaiting())
frameLabel = tk.Frame(self, padx=40, pady =40)
self.text = tk.Text(frameLabel, wrap='word', font='TimesNewRoman 37',
self.queue = Queue.Queue()
thread = SerialThread(self.queue)
app = App()