Python entry box ⌨️

preview_player
Показать описание
Python entry box widget tkinter GUI code example tutorial beginners

#Python #entry #box #widget #tkinter #GUI #code #example #tutorial #beginners

from tkinter import *

#entry widget = textbox that accepts a single line of user input

def submit():
print("Hello "+username)

def delete():

def backspace():

window = Tk()

entry = Entry(window,
font=("Arial",50),
fg="#00FF00",
bg="black")

submit_button = Button(window,text="submit",command=submit)

delete_button = Button(window,text="delete",command=delete)

backspace_button = Button(window,text="backspace",command=backspace)

Рекомендации по теме
Комментарии
Автор

def display():
if(x.get()):
print("I like Python")
else:
print("I don't like Python")

window = Tk()

x = IntVar()

python_photo =

checkbox = Checkbutton(window,
text='Python',
variable=x,
onvalue=True,
offvalue=False,
command=display,
font=('Arial', 20),
fg='#00FF00',

activeforeground='#0000FF',

padx=25,
pady=10,
width=200,
height=50,
anchor='w',
image=python_photo,
compound='left')
checkbox.pack()

window.mainloop()

BroCodez
Автор

# For people trying to get this to work in the future use ."get" to get the contents of entry and the len() function to find the length of the string
def delete():
str_length = len(entry.get())
entry.delete(0, str_length)

# backspace is pretty much the same
def backspace():
str_length = len(entry.get())
entry.delete(str_length-1)

PURlCHAS
Автор

"Hello ergergergergergerg" 🤣
Bro, thank you for the great beginning of my day

liudmilarodzina
Автор

Sorry for not watching videos yesterday bro. Continuing the grind today.

lw
Автор

This is
oops, left 'show="*"' on
This is great! Thank you!

creator
Автор

great staff. Was wondering if function delete and others can be made to be more universal so any entry connected to it would work properly...

michaelk
Автор

amazing video
but the code you commented is for the next video not this one

arshamcfr
Автор

does .delete() take negative indexes like -1? if it takes, does .delete(-2, -1) have the same effect of the backspace?

arkamukhopadhyay
Автор

how to get int or float input from user?

anonymoushelp
Автор

I created multiple entry boxes but the backspace and delete keys affect all the boxes simultaneously.. How do I prevent? I want only the active box to be affected. Help.

captain_ali_
Автор

Hi dude, how I can change the color to a disabled entry box?

vdafs
Автор

thank you ergergegrgeregr, you're ergsome!

thrasherbassboy
Автор

My font never changes. I specified it to Arial.

omairtech