Python text box - python

I am trying to take input name, email and password from user and print it in screen. But the variable is took is showing none every time. Can anyone solve my problem?
import tkinter as tk
import tkinter.font as f
r = tk.Tk()
name=''
email=''
password=''
def Print():
print("Name is",name)
print("Email is",email)
print("Password is",password)
f=tk.Frame(r,height=600,width=900)
f.pack()
name = tk.Label(f, text = "Name").place(x = 30,y = 50)
email = tk.Label(f, text = "Email").place(x = 30, y = 90)
password = tk.Label(f, text = "Password").place(x = 30, y = 130)
sbmitbtn = tk.Button(f, text = "Submit",activebackground = "pink", activeforeground = "blue",command=lambda:[Print(),f.destroy()]).place(x = 30, y = 170)
e1 = tk.Entry(f,textvariable=name).place(x = 80, y = 50)
e2 = tk.Entry(f,textvariable=email).place(x = 80, y = 90)
e3 = tk.Entry(f,textvariable=password).place(x = 95, y = 130)
r.mainloop()

you can use StringVar to get the string. the textvariable in your Label needs to be a Tkinter variable, quote:
"
textvariable= Associates a Tkinter variable (usually a StringVar) to
the contents of the entry field. (textVariable/Variable)
you can read more here
import tkinter as tk
import tkinter.font as f
r = tk.Tk()
name = tk.StringVar()
email = tk.StringVar()
password = tk.StringVar()
def Print():
print("Name is", name.get())
print("Email is", email.get())
print("Password is", password.get())
f = tk.Frame(r, height=600, width=900)
f.pack()
tk.Label(f, text="Name").place(x=30, y=50)
tk.Label(f, text="Email").place(x=30, y=90)
tk.Label(f, text="Password").place(x=30, y=130)
sbmitbtn = tk.Button(f, text="Submit", activebackground="pink", activeforeground="blue",
command=lambda: [Print(), f.destroy()]).place(x=30, y=170)
e1 = tk.Entry(f, textvariable=name).place(x=80, y=50)
e2 = tk.Entry(f, textvariable=email).place(x=80, y=90)
e3 = tk.Entry(f, textvariable=password).place(x=95, y=130)
r.mainloop()

Related

_tkinter.TclError: bad window path name ".!frame2"

I am making a project which is supposed to close the first window and open a new one, but I get this error in line 101 which says "d2.pack()" in the roll() function. I want to make it so whenever you press the "roll" button, the old frame with the old roll dissapears and a new one will appear in the exact same place with the new roll, before it would just appear underneath the old roll so I tried to do something to make it work, but nothing has worked yet. I have tried quite some things but nothing works. As I am quite new to coding, any help would be appreciated.
from csv import excel_tab
import sqlite3
from turtle import width
from argon2 import PasswordHasher
from tkinter import *
from tkinter import ttk
import atexit
global active_user
def raise_frame(frame):
frame.tkraise()
ph = PasswordHasher()
root = Tk()
root.geometry("750x500")
f1 = Frame(root)
f2 = Frame(root)
f3 = Frame(root)
for frame in (f1, f2, f3):
frame.pack()
con = sqlite3.connect("nope you're not getting this")
cur = con.cursor()
def slots():
return
def createAcc():
password = newPass.get()
usernameNew = newUser.get()
hashed_password = ph.hash(password)
cur.execute("INSERT INTO thing (user, money, password, sessionactive) VALUES (?,?,?,?)", (usernameNew, 10000, hashed_password, 0))
con.commit()
main()
def login():
global entryUsername
global entryPass
label = Label(f2, text="Enter username and password", font=("Courier 22 bold"))
label.pack(padx=0, pady=10)
entryUsername = Entry(f2, width= 40)
entryUsername.focus_set()
entryUsername.pack(padx=0, pady=10)
entryPass = Entry(f2, width= 40)
entryPass.focus_set()
entryPass.pack()
ttk.Button(f2, text= "Enter",width= 20, command=loginCheck).pack(pady=20)
raise_frame(f2)
def create():
global newUser
global newPass
label = Label(f3, text="Create username and password", font=("Courier 22 bold"))
label.pack(padx=0, pady=10)
newUser = Entry(f3, width= 40)
newUser.focus_set()
newUser.pack(padx=0, pady=10)
newPass = Entry(f3, width= 40)
newPass.focus_set()
newPass.pack()
ttk.Button(f3, text= "Enter",width= 20, command=createAcc).pack(pady=20)
raise_frame(f3)
def loginCheck():
global username
global active_user
i = 0
password = entryPass.get()
username = entryUsername.get()
cur.execute("SELECT * FROM thing")
data = cur.fetchall()
while i < len(data):
if data[i][0] == username and ph.verify(data[i][2], password) == True:
active_user = username
main()
else:
i += 1
print("Invalid username or password, please try again")
def roll():
global d2
new_frame = d2
if d2 is not None:
d2.destroy()
d2 = new_frame
d2.pack() #here's the error
Label(d2, text="test", font=("Courier 22 bold")).pack()
def main():
global root
global root2
global d1
global d2
f1.destroy()
root2 = Tk()
d1 = Frame(root2)
d2 = Frame(root2)
for frame in (d1, d2):
frame.pack()
root2.geometry("750x500")
Label(root2, text="Press roll to roll the slots", font=("Courier 22 bold")).pack(pady=20)
ttk.Button(d1, text="Roll", width=20, command=roll).pack(pady=40)
root2.mainloop()
def mainScreen():
label = Label(f1, text="Welcome to epic gambling thing!", font=("Courier 22 bold"))
label.pack(padx=0, pady=10)
ttk.Button(f1, text= "Login",width= 20, command=login).pack(pady=20)
raise_frame(f1)
ttk.Button(f1, text= "Create Account",width= 20, command=create).pack(pady=20)
mainScreen()
root.mainloop()

Python Deleting Rows Based On One Input

I'm making a program with a GUI using Tkinter.
The program receives a CSV file. And then has functions Add Delete Update
I'm done with the add part, but I could also finish the delete part, but somehow I just want to try out deleting via column. For example, entry is:
2012-1221, Name Lastname,
I want to delete all this entry just by the ID Number 2012-1221
I can't just do it. Here's my code:
from Tkinter import *
import sys
import sys
import os
import operator
import datetime
import csv
import fileinput
root = Tk()
root.title("SCS Club/Guilds/Committee System")
root.grid()
root.geometry("400x450")
root.resizable(width=False, height=False)
files = StringVar()
label = Label(root, text="Clearance and Management", bg="white", fg="black")
label.pack(fill=X)
label1 = Label(root, text="Student Record", bg = "lightgreen", font = "chiller 20 bold").pack()
label2 = Label(root, text ="Enter file name:").pack()
fileName = Entry(root, textvariable=files, relief=GROOVE, bg="lightgreen").pack()
def fileOpen():
def newWindow():
def addData():
idGet = str(idno.get())
nameGet = str(nme.get())
courseGet = str(crse.get())
yearGet = str(yr.get())
fileNameGet = str(files.get())
with open(fileNameGet, 'ab') as csvfile:
writer = csv.writer(csvfile, delimiter=',', quotechar = '|')
completeFields = idGet + ',' + nameGet +','+ courseGet +','+ yearGet
writer.writerow([completeFields])
addEntry.delete(0,"end")
idEntry.delete(0,"end")
crseEntry.delete(0,"end")
newWin = Toplevel()
newWin.geometry("400x200")
newWin.resizable(width=False,height=False)
newWin.title("Add Student")
addId = Label(newWin, text="ID Number").grid(row=1, column=0)
idno = StringVar(None)
idEntry = Entry(newWin, textvariable=idno,bg="lightgreen")
idEntry.grid(row=1, column=1)
addNme = Label(newWin, text="Name").grid(row=2, column=0)
nme = StringVar(None)
addEntry = Entry(newWin, textvariable=nme, text="Name")
addEntry.grid(row=2, column=1)
addCrse = Label(newWin, text="course").grid(row=3, column=0)
crse = StringVar(None)
crseEntry = Entry(newWin, textvariable=crse, text="Course")
crseEntry.grid(row=3, column=1)
addYr = Label(newWin, text="Year").grid(row=4, column=0)
yr = StringVar(None)
yrEntry = Entry(newWin, textvariable=yr, text="Year")
yrEntry.grid(row=4, column=1)
addFinal = Button(newWin, text="ADD", command=addData, relief=GROOVE).grid(row=5, column=1)
def deleteWindow():
def deleteData():
getID = str(idno.get())
fileName = str(files.get())
f = open(fileName,"r")
lines = f.readlines()
f.close()
f = open(fileName,"w")
for line in lines:
if line!=getID+"\n":
f.write(line)
f.close()
idEntry.delete(0,"end")
msg = Label(deleteWin, text="Removed Successfully", font="fixedsys 12 bold").place(x=10,y=50)
deleteWin = Toplevel()
deleteWin.geometry("200x100")
deleteWin.resizable(width=False, height=False)
deleteWin.title("DELETE")
delete_id = Label(deleteWin, text="ID Number ").grid(row=0,column=0)
idno = StringVar(None)
idEntry = Entry(deleteWin, text=idno, bg="lightgreen")
idEntry.grid(row=0,column=1)
deleteFinal = Button(deleteWin, text="REMOVE", command=deleteData, relief=GROOVE).grid(row=4, column=1)
filename = str(files.get())
nfile = open(filename, 'a+')
display = Label(root, text="Opened file successfully", font = "fixedsys 12 bold").place(x=10,y=120)
studentList = Listbox(root, width=45, height=14, bg="lightgreen")
for line in nfile:
studentList.insert(END, line)
studentList.place(x=12, y=200)
nfile.close()
addStud = Button(root, text="Add Student", width = 12, height = 2, command=newWindow, relief=GROOVE).place(x=12,y=150)
deleteStud = Button(root, text="Remove Student", width = 12, height = 2,command=deleteWindow, relief=GROOVE).place(x=115,y=150)
updateStud = Button(root, text="Update", width = 9, height = 2,command=updateWindow, relief=GROOVE).place(x=215, y=150)
addFile = Button(root, text="Open File", width = 12, height = 2, command=fileOpen, relief=GROOVE).pack()
root.mainloop()
root.mainloop()
Please look at my delete part. I can delete an entry but I have to Spell out everything, and for the users it would be a hassle right? I want to make it easier by deleting the entry via ID number only. Any help is appreciated. Thanks!

Creating Tkinter Text boxes and inserting into a dictionary

I have a long chunk of code. I do not want to paste it all here, so let me explain what I am trying to accomplish here. Based on a number provided by the user I want to create that many text boxes and then get what is entered into that text box and insert that into the dictionary. I have tried this a few ways and just cannot get it to work correctly. The list is either empty or it only contains the last text box as the value for each key.
def multiple_choice():
def add():
top.destroy()
top = Tk()
top.title("Add Question")
w = 800
h = 800
ws = top.winfo_screenwidth()
hs = top.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
top.geometry('%dx%d+%d+%d' % (w, h, x, y))
question = Label(top, text="Question to be asked?", font = "Times 14 bold", fg = "blue")
question.grid(row = 2, column = 4)
questionText = Text(top, borderwidth = 5, width=50,height=5, wrap=WORD, background = 'grey')
questionText.grid(row = 3, column = 4)
numQuestions = Label(top, text = "Number of answer choices?", font = "Times 14 bold", fg = "blue")
numQuestions.grid(row = 4, column=4)
num = Entry(top, bd = 5)
num.grid(row=5, column = 4)
answerList = {}
def multiple():
def preview():
preview = Tk()
top.title("Question Preview")
w = 500
h = 500
ws = top.winfo_screenwidth()
hs = top.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
top.geometry('%dx%d+%d+%d' % (w, h, x, y))
title = Label(preview, text = "Short Answer Question Preview", font = "Times 18 bold", fg = "blue" )
title.grid(row = 0, column = 2)
qtext = "Question text will read: "
ques = Label(preview, text = qtext)
ques.grid(row=1, column = 2)
ques2 = Label( preview, text = questionText.get("1.0",END))
let = 'A'
i = 1
for word in answerList:
prev = let + ": " + word
ans = Label(preview, text = prev)
ans.grid(row=1+i, column = 2)
let = chr(ord(let) + 1)
answerCor = "The correct answer(s): "
a = Label(preview, text = answerCor)
a.grid(row=4, column = 2)
b = Label(preview, text = cor.get)
b.grid(row=5, column = 2)
if num.get().isdigit():
number = int(num.get())
AnswerChoices = Label(top, text = "Answer Choices?", font = "Times 14 bold", fg = "blue")
AnswerChoices.grid(row = 6, column=4)
i = 0
let = 'A'
while i < number:
letter = Label(top, text = let)
letter.grid(row = 8+(i*4), column = 3)
answer = Text(top, borderwidth = 5, width=50, height=3, wrap=WORD, background = 'grey')
answer.grid(row = 8+(i*4), column = 4)
answerList[let] = answer.get("1.0",END)
i = i+1
let = chr(ord(let) + 1)
print answerList
correct = Label(top, text = "Correct Answer(s) (seperated by commas)",
font = "Times 14 bold", fg = "blue")
correct.grid(row =99 , column=4)
cor = Text(top, borderwidth = 5, width=50, height=3, wrap=WORD, background = 'grey')
cor.grid(row=100, column = 4)
else:
error = Tk()
w = 500
h = 100
ws = top.winfo_screenwidth()
hs = top.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
error.geometry('%dx%d+%d+%d' % (w, h, x, y))
text = "ERROR: You must enter an integer number"
Label(error,text = text, fg = "red", font = "Times 16 bold").pack()
MyButton5 = Button(top, text="Preview Question", width=20, command = preview, anchor=S)
MyButton5.grid(row=102, column=5)
MyButton4 = Button(top, text="Finish and Add Question", width=20, command = add, anchor=S)
MyButton4.grid(row=102, column=2)
but = Button(top, text="Submit", width=10, command = multiple)
but.grid(row=6, column = 4)
top.mainloop()
def button():
MyButton21 = Button(quiz, text="Short Answer Question", width=20, command = short_answer)
MyButton21.grid(row=8, column=2)
MyButton22 = Button(quiz, text="True/False Question", width=20, command = true_false)
MyButton22.grid(row=8, column=4)
MyButton23 = Button(quiz, text="Multiple Choice Question", width=20, command = multiple_choice)
MyButton23.grid(row=9, column=2)
#MyButton24 = Button(quiz, text="Matching Question", width=20, command = matching)
#MyButton24.grid(row=9, column=4)
MyButton25 = Button(quiz, text="Ordering Question", width=20, command =order)
MyButton25.grid(row=10, column=2)
MyButton26 = Button(quiz, text="Fill in the Blank Question", width=20, command = fill_blank)
MyButton26.grid(row=10, column=4)
MyButton3 = Button(quiz, text="Finsh Quiz", width=10, command = quiz)
MyButton3.grid(row=12, column=3)
quiz = Tk()
w = 700
h = 300
ws = quiz.winfo_screenwidth()
hs = quiz.winfo_screenheight()
x = 0
y = 0
quiz.geometry('%dx%d+%d+%d' % (w, h, x, y))
quiz.title("eCampus Quiz Developer")
L1 = Label(quiz, text="Quiz Title?")
L1.grid(row=0, column=0)
E1 = Entry(quiz, bd = 5)
E1.grid(row=0, column=3)
name_file = E1.get()
name_file = name_file.replace(" ", "")
name_file = name_file + ".txt"
with open(name_file,"w") as data:
MyButton1 = Button(quiz, text="Submit", width=10, command = button)
MyButton1.grid(row=1, column=3)
quiz.mainloop()
I am trying to create the dictionary using this chunk of code:
i = 0
let = 'A'
while i < number:
letter = Label(top, text = let)
letter.grid(row = 8+(i*4), column = 3)
answer = Text(top, borderwidth = 5, width=50, height=3, wrap=WORD, background = 'grey')
answer.grid(row = 8+(i*4), column = 4)
answerList[let] = answer.get("1.0",END)
i = i+1
let = chr(ord(let) + 1)
I have even tried putting a loop in the preview function but that is when the last box was the only value contained in the dictionary. Any ideas would be appreciated
Please see my commeneted snippet below which demonstrates this:
from tkinter import *
class App:
def __init__(self, root):
self.root = root
self.entry = Entry(self.root) #entry to input number of entries later
self.button = Button(self.root, text="ok", command=self.command) #calls command to draw the entry boxes
self.frame = Frame(self.root)
self.entry.pack()
self.button.pack()
self.frame.pack()
def command(self):
self.frame.destroy() #destroys frame and contents
self.frame = Frame(self.root) #recreates frame
self.text = [] #empty array to store entry boxes
for i in range(int(self.entry.get())):
self.text.append(Entry(self.frame, text="Question "+str(i))) #creates entry boxes
self.text[i].pack()
self.done = Button(self.frame, text="Done", command=self.dict) #button to call dictionary entry and print
self.done.pack()
self.frame.pack()
def dict(self):
self.dict = {}
for i in range(len(self.text)):
self.dict.update({self.text[i].cget("text"): self.text[i].get()})
#the above line adds a new dict entry with the text value of the respective entry as the key and the value of the entry as the value
print(self.dict) #prints the dict
root = Tk()
App(root)
root.mainloop()
The above asks the user how many entry widgets they want to create, fills a frame with those entry widgets and then iterates through the list which contains them on the press of a button, adding a new dictionary entry for each entry widget, where the key of the dict is the attribute text for each entry and the value of the dict is the value of each entry.

Using validation on text entry box

I am trying to set up validation on text entry boxes. Three of the boxes need to only accept integers and one text as a postcode. I am not sure whether to do this in a function previously defined or when the entry boxes are created. Also how would i make the values from the text entry boxes be accessable in the function QuoteCreation. All my code is below.
from tkinter import *
class quote():
def __init__(self, master):
self.master=master
self.master.title("Quote Screen")
self.master.geometry("2100x1400")
self.master.configure(background = "white")
self.Borras = PhotoImage(file = "Borras.Logo.2.gif") #sets up image
self.Borras.image = self.Borras
self.BorrasLabel = Label(self.master, image = self.Borras, bg = "white")#puts image onto label
self.BorrasLabel.place(anchor=NW)
self.Title = Label(self.master, text = "New Quote", font = ("calibri", 20), bg = "White")
self.Title.place(x=650, y = 10)
self.SubmitButton = PhotoImage(file = "Submit.Button.gif") #sets up image
self.SubmitButton.image = self.SubmitButton
self.SubmitButtonLabel = Button(self.master, image = self.SubmitButton, bg = "white", command= self.QuoteCreation)#puts image onto a button
self.SubmitButtonLabel.place(x=900, y=290)
PostCodeVar = StringVar()
PostCodeEntry = Entry(master,width=50, font=20, textvariable=PostCodeVar)
PostCodeEntry.place(x = 20, y = 150)
PostCodeVar.set("Please enter the Post Code")
PostCodeValue = PostCodeVar.get()
HeightVar = StringVar()
HeightEntry = Entry(master, width=50, font=20, textvariable=HeightVar)
HeightEntry.place(x = 20, y = 220)
HeightVar.set("Please enter the Height")
HeightValue = HeightVar.get()
LengthVar = StringVar()
LengthEntry = Entry(master, width=50, font=20, textvariable=LengthVar)
LengthEntry.place(x = 20, y = 290)
LengthVar.set("Please enter the Length")
LengthValue = LengthVar.get()
PitchVar = StringVar()
PitchEntry = Entry(master, width=50, font=20, textvariable=PitchVar)
PitchEntry.place(x = 20, y = 360)
PitchVar.set("Please enter the Pitch")
PitchValue = PitchVar.get()
RiseVar = StringVar()
RiseEntry = Entry(master, width=50, font=20, textvariable=RiseVar)
RiseEntry.place(x = 20, y = 430)
RiseVar.set("Please enter the Rise")
RiseValue = RiseVar.get()
self.SubmitButton = PhotoImage(file = "Submit.Button.gif")
self.SubmitButton.image = self.SubmitButton
self.SubmitButtonLabel = Button(self.master, image = self.SubmitButton, bg = "white", command= self.QuoteCreation)#puts image onto a button
self.SubmitButtonLabel.place(x=900, y=290)
def on_button(self):
print(self.entry.get())
def QuoteCreation(self):
print(' ')
def quitWindow(self):
self.master.destroy()
def backToWelcome(self):
self.master.destroy()
You would set up separate functions to deal with the validation, when the submit button is pressed.
So, as an example, your submit button may look a bit like this:
submitButton = Button(master, text="Submit", command=validation)
The validation, in your case would then want to carry out these checks:
def validation():
postcode = PostCodeVar.get()
length = LengthVar.get()
pitch = PitchVar.get()
rise = RiseVar.get()
if postcodeCheck(postcode) == True and length.isdigit() == True and pitch.isdigit() == True and rise.isdigit() == True:
#carry out chosen process
In your case, you can try setting the postcode, length, pitch and height variables before calling the function, and setting them as global. The postcode should be created, and if it is okay, the function should then:
return True
...so it matches the outcome of the if statement.
I hope this is what you were looking for, and can adapt the example to your specific problem!

Discussion with tkinter

from tkinter import *
window = Tk()
ia_answers= "trolol"
input_frame = LabelFrame(window, text="User :", borderwidth=4)
input_frame.pack(fill=BOTH, side=BOTTOM)
input_user = StringVar()
input_field = Entry(input_frame, text=input_user)
input_field.pack(fill=BOTH, side=BOTTOM)
ia_frame = LabelFrame(window, text="Discussion",borderwidth = 15, height = 100, width = 100)
ia_frame.pack(fill=BOTH, side=TOP)
user_says = StringVar()
user_text = Label(ia_frame, textvariable=user_says, anchor = NE, justify = RIGHT, bg="white")
user_text.pack(fill=BOTH, side=TOP)
ia_says = StringVar()
ia_text = Label(ia_frame, textvariable=ia_says, anchor = W, justify = LEFT, bg="white")
ia_text.pack(fill=BOTH, side=BOTTOM)
def Enter_pressed(event):
"""Took the current string in the Entry field."""
input_get = input_field.get()
input_user.set("")
user_says.set(input_get + "\n\n")
ia_says.set(ia_answers)
input_field.bind("<Return>", Enter_pressed)
window.mainloop()
Hi, i am trying to build a discussion Bot.
When I execute the code, the question in the input field and the answer get displayed correctly.
The problem is after entering the next sentence, the previous question/answer gets removed. Here is an example:
Hello Bot
Hello User
(then the text disappears)
How are you
Fine thank you
What i want :
Hello Bot
Hello User
(then the text stays in the frame)
How are you
Fine thank you
The issue occurs in line -
user_says.set(input_get + "\n\n")
ia_says.set(ia_answers)
You are replace users_says.set() and ia_says.set() resets the complete Labels , with the new value. Instead you should get the old value and append the new value to it and set it back, Example -
user_says.set(user_says.get() + input_get + "\n")
ia_says.set(ia_says.get() + ia_answers + "\n")
Or you can also create a new label for each new event and add it to the LabelFrame . Example -
from tkinter import *
window = Tk()
ia_answers= "trolol\n"
input_frame = LabelFrame(window, text="User :", borderwidth=4)
input_frame.pack(fill=BOTH, side=BOTTOM)
input_user = StringVar()
input_field = Entry(input_frame, text=input_user)
input_field.pack(fill=BOTH, side=BOTTOM)
ia_frame = LabelFrame(window, text="Discussion",borderwidth = 15, height = 100, width = 100)
ia_frame.pack(fill=BOTH, side=TOP)
user_says = StringVar()
user_text = Label(ia_frame, textvariable=user_says, anchor = NE, justify = RIGHT,
bg="white")
user_text.pack(fill=X)
ia_says = StringVar()
ia_text = Label(ia_frame, textvariable=ia_says, anchor = NW, justify = LEFT, bg="white")
ia_text.pack(fill=X)
user_texts = []
ia_texts = []
user_says_list = []
ia_says_list = []
def Enter_pressed(event):
"""Took the current string in the Entry field."""
input_get = input_field.get()
input_user.set("")
user_says1 = StringVar()
user_says1.set(input_get + "\n")
user_text1 = Label(ia_frame, textvariable=user_says1, anchor = NE, justify = RIGHT,
bg="white")
user_text1.pack(fill=X)
user_texts.append(user_text1)
user_says_list.append(user_says1)
ia_says1 = StringVar()
ia_says1.set(ia_answers)
ia_text1 = Label(ia_frame, textvariable=ia_says1, anchor = NW, justify = LEFT,
bg="white")
ia_text1.pack(fill=X)
ia_texts.append(ia_text1)
ia_says_list.append(ia_says1)
input_field.bind("<Return>", Enter_pressed)
window.mainloop()

Categories