Python Forum
Entry Widget issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Entry Widget issue
#5
Sorry I could not update the modified code

import serial
from tkinter import *
import matplotlib.pyplot as plt
from drawnow import *

values = []
root = Tk()
plt.ion()
cnt=0
var = StringVar()
serialArduino = serial.Serial('COM3',baudrate = 9600, timeout = 1)
root.title("D Cube Serial Read")
e = Entry(root,width = 35, textvariable = var ,borderwidth = 5)
e.grid(row = 0, column = 0, columnspan = 3,padx = 10,pady = 10)

def plotValues():
     plt.legend(loc='upper right')
    
while True:
    while (serialArduino.inWaiting()==0):
        pass
    valueRead = serialArduino.readline()
    print(valueRead)

    #check if valid value can be casted
    try:
        valueInInt = int(valueRead)
        print(valueInInt)
        e.delete(0,END)
        #e.insert(1,valueInInt)
        var.set(valueInInt)
        #drawnow(plotValues)
                
           
    except ValueError:
        print ("Invalid! cannot cast")
as you can see the I commented the following line then widgets does not open but on the python shell values are displayed

#drawnow(plotValues)
Reply


Messages In This Thread
Entry Widget issue - by PA3040 - Feb-17-2020, 07:15 PM
RE: Entry Widget issue - by Larz60+ - Feb-18-2020, 03:20 AM
RE: Entry Widget issue - by PA3040 - Feb-19-2020, 06:41 PM
RE: Entry Widget issue - by Larz60+ - Feb-19-2020, 08:53 PM
RE: Entry Widget issue - by PA3040 - Feb-20-2020, 05:54 PM
RE: Entry Widget issue - by Larz60+ - Feb-21-2020, 03:35 AM
RE: Entry Widget issue - by PA3040 - Feb-21-2020, 05:33 AM
RE: Entry Widget issue - by Larz60+ - Feb-21-2020, 12:12 PM
RE: Entry Widget issue - by PA3040 - Mar-03-2020, 05:34 AM
RE: Entry Widget issue - by Larz60+ - Mar-03-2020, 08:58 AM
RE: Entry Widget issue - by PA3040 - Mar-04-2020, 01:33 PM
RE: Entry Widget issue - by Larz60+ - Mar-04-2020, 05:39 PM
RE: Entry Widget issue - by PA3040 - Mar-06-2020, 05:15 AM
RE: Entry Widget issue - by Larz60+ - Mar-06-2020, 10:24 AM
RE: Entry Widget issue - by Kurta - Jan-05-2021, 03:02 AM
RE: Entry Widget issue - by deanhystad - Jan-05-2021, 04:20 AM
RE: Entry Widget issue - by pitterbrayn - Jan-20-2021, 02:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ValueError: could not convert string to float: '' fron Entry Widget russellm44 5 890 Mar-06-2024, 08:42 PM
Last Post: russellm44
  [Tkinter] entry widget DPaul 5 1,615 Jul-28-2023, 02:31 PM
Last Post: deanhystad
  Tkinter Exit Code based on Entry Widget Nu2Python 6 3,083 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [Tkinter] canvas widget scroll issue chrisdb 2 3,934 Apr-07-2021, 05:48 AM
Last Post: chrisdb
  method to add entries in multi columns entry frames in self widget sudeshna24 2 2,318 Feb-19-2021, 05:24 PM
Last Post: BashBedlam
  [Tkinter] password with Entry widget TAREKYANGUI 9 6,133 Sep-24-2020, 05:27 PM
Last Post: TAREKYANGUI
  [Tkinter] Get the last entry in my text widget Pedroski55 3 6,512 Jul-13-2020, 10:34 PM
Last Post: Pedroski55
  Date entry in box format issue PeroPuri 6 8,396 Apr-25-2020, 11:03 PM
Last Post: PeroPuri
  How to retreive the grid location of an Entry widget kenwatts275 7 4,750 Apr-24-2020, 11:39 PM
Last Post: Larz60+
  POPUP on widget Entry taratata2020 4 3,828 Mar-10-2020, 05:04 PM
Last Post: taratata2020

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020