I've been trying to make a simple program to compare three numbers. I just used the START and STOP buttons for the sake of using Tkinter but now I wanted to insert some Entry Boxes to input data instead of the simple IDLE.
Every time I try to fix it I get the same ValueError
I've tried using IntVar, taking multiple variables and stuff, but I couldn't get to a conclusion. I also wouldn't like to use IntVar because my teacher's going to be mad if I use it and I don't know why =P
t1 = tk.Entry(root)
t1.grid(row = 8, column = 0)
t2 = tk.Entry(root)
t2.grid(row = 10, column = 0)
t3 = tk.Entry(root)
t3.grid(row = 12, column = 0)
x = int(t1.get())
y = int(t2.get())
z = int(t3.get())
ERROR:
Traceback (most recent call last): File "C:/Users/CB Singh/Desktop/Compare01.py", line 25, in x = int(t1.get()) ValueError: invalid literal for int() with base 10: ''
text1=tk.IntVar()
t1 = tk.Entry(root,textvariable=text1)
t2 = t1.get()
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加