import serial from tkinter import * root = Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.geometry("%dx%d+0+0" % (w, h-200)) root.attributes('-fullscreen', True) varo = StringVar() varo.set('test1') c=0 o = Label(root, textvariable=varo,bg="lightblue") o.pack() o.place(relx=0.5, rely=0.5, anchor="n") try: ser = serial.Serial("/dev/ttyUSB0", 38400) except: True while TRUE: try: cc=str(ser.readline()) except: True c=c+1 varo.set(c) print(c) root.update_idletasks() root.mainLoop()