DEV Community

Kaveh Sabouri
Kaveh Sabouri

Posted on

5 2

How to create a Python login page with tkinter

from tkinter import *
from tkinter import messagebox

window = Tk()
window.geometry("400x400")
window.title("Login")
window.config(bg="#f07167")

lbl1=Label(window,text="Login",font=("",40),fg="#fed9b7",bg="#f07167")
lbl1.pack(anchor="center")


lbl2=Label(window,text="Email:",font=("",30),fg="#fdfcdc",bg="#f07167")
lbl2.place(x=10,y=90)

ent1=Entry(window)
ent1.place(x=200,y=100)



lbl3=Label(window,text="Password:",font=("",30),fg="#fdfcdc",bg="#f07167")
lbl3.place(x=10,y=170)

ent3=Entry(window)
ent3.place(x=200,y=180)


btn1=Button(window,text="Apply",font=("",25),bg="#f07167")
btn1.place(x=150,y=300)
window.mainloop()
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay