Entry box with python

 from tkinter import *

def submit():
    username = entry.get()
    print("Hello",username)
    # entry.config(state=DISABLED)

def delete():
    entry.delete(0,END)

def space():
    entry.delete(len(entry.get())-1END)
def hide():
    entry.config(show="*")


window = Tk()
entry = Entry(window,
              font=("Arial"30,),fg="cyan",bg="black",)
entry.pack(side=LEFT)

entry.insert(0"password")





submit_btn = Button(window, text="Submit"command=submit,
                    font=("Comic"20), bg="black"fg="cyan")
submit_btn.pack(side=RIGHT)


delete_btn = Button(window, text="Delete"command=delete,
                    font=("Comic"20), bg="black"fg="cyan")
delete_btn.pack(side=RIGHT)

space_btn = Button(window, text="Backspace"command=space,
                   font=("Comic"20), bg="black"fg="cyan")
space_btn.pack(side=RIGHT)


hide = Button(window, text="hide"command=hide,
              font=("Comic"20), bg="black"fg="cyan")
hide.pack(side=RIGHT)



window.mainloop()

Comments