0% found this document useful (0 votes)
11 views4 pages

Tkinter Test

Python Tkinter

Uploaded by

vidhikaliraman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Tkinter Test

Python Tkinter

Uploaded by

vidhikaliraman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

9/15/23, 6:31 PM Untitled3 - Jupyter Notebook

In [19]: from tkinter import *


from tkinter import messagebox
from PIL import Image,ImageTk
import pyqrcode
import png
from pyqrcode import QRCode
a=Tk()
a.title("Login/Sign UP Page")
a.geometry('750x550')
a.config(bg='skyblue')
a.resizable(width=True,height=True)
A=Image.open("a1.jpg")
B=ImageTk.PhotoImage(A)
C=Image.open('qrcode.png')
D=ImageTk.PhotoImage(C)
def login():
a1=Tk()
a1.title("Login Page")
a1.geometry('750x550')
a1.config(bg='cyan')
a1.resizable(width=True,height=True)
def submit():
Username=StringVar()
Password=StringVar()
Username=e1.get()
Password=e2.get()
if Username=="admin" and Password=="admin@123":
messagebox.showinfo("Info","You have logged in successfully")
print("Welcome")
else:
messagebox.showerreor("Error","Username or password is incorrect")
print("Sorry you have entered wrong username or password")
l1=Label(a1,text='Login Here',font=('algerian',22,"bold"),width=15,height=2,
bg="white",fg='black',bd=6,relief='ridge')
l1.pack()
l2=Label(a1,text='Username',font=('algerian',22,"bold"),width=15,height=2
,bg="white",fg='Blue',bd=6,relief='ridge')
l2.place(x=100,y=120)
l3=Label(a1,text='Password',font=('algerian',22,"bold"),width=15,height=2,bg="white",
fg='Blue',bd=6,relief='ridge')
l3.place(x=100,y=210)

localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 3/6
9/15/23, 6:31 PM Untitled3 - Jupyter Notebook

e1=Entry(a1,width=18,bg='white',fg='black')
e1.place(x=430,y=150)
e2=Entry(a1,width=18,bg='white',fg='black')
e2.place(x=430,y=240)
b1=Button(a1,text='Submit',font=('algerian',22,"bold"),width=12,height=1,bg="white",fg='black',
bd=6,relief='ridge',activebackground='pink',command=submit)
b1.place(x=240,y=310)
def sign():
a2=Tk()
a2.title("Sign UP Page")
a2.geometry('750x550')
a2.config(bg='skyblue')
a2.resizable(width=True,height=True)
def submit1():
Password=StringVar()
ConfirmPass=StringVar()
Phoneno=StringVar()
Password=e4.get()
ConfirmPass=e5.get()
Phoneno=e6.get()
if Password==ConfirmPass:
if len(Phoneno)==10:
messagebox.showinfo("Info","You are entered successfully..")
print("Welcome")
else:
messagebox.showwarning("Warning","You have entered invalid number!")
print("Enter a valid phone no")
else:
messagebox.showerror("Error","Password and confirm Password does not match")
print("password and confirm password does not match")
l1=Label(a2,text='Sign Up',font=('algerian',22,"bold"),width=15,height=2,bg="white"
,fg='black',bd=6,relief='ridge')
l1.pack()
l2=Label(a2,text='First Name',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
l2.place(x=40,y=80)
l3=Label(a2,text='Last Name',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',

fg='white',bd=5,relief='flat')
l3.place(x=40,y=150)
l4=Label(a2,text='Username',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 4/6
9/15/23, 6:31 PM Untitled3 - Jupyter Notebook

l4.place(x=40,y=220)
l5=Label(a2,text='Password',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
l5.place(x=40,y=290)
l6=Label(a2,text='ConfirmPass',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
l6.place(x=40,y=360)
l7=Label(a2,text='Phoneno',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
l7.place(x=40,y=430)
l8=Label(a2,text='Email id',font=('callibri',20,'bold'),width=12,height=1,bg='navyblue',
fg='white',bd=5,relief='flat')
l8.place(x=40,y=500)
e1=Entry(a2,width=18,bg="white",fg="black")
e1.place(x=300,y=90)
e2=Entry(a2,width=18,bg="white",fg="black")
e2.place(x=300,y=160)
e3=Entry(a2,width=18,bg="white",fg="black")
e3.place(x=300,y=230)
e4=Entry(a2,width=18,bg="white",fg="black")
e4.place(x=300,y=300)
e5=Entry(a2,width=18,bg="white",fg="black")
e5.place(x=300,y=370)
e6=Entry(a2,width=18,bg="white",fg="black")
e6.place(x=300,y=440)
e7=Entry(a2,width=18,bg="white",fg="black")
e7.place(x=300,y=510)
b1=Button(a2,text='Submit',font=('algerian',22,"bold"),width=11,height=1,bg="white",fg='blue',
bd=6,relief='ridge',activebackground='pink',command=submit1)
b1.place(x=150,y=560)
def quit():
A=messagebox.askyesno("Yes/no","Do you want to finally exit")
if A>0:
a.destroy()
else:
pass
l=Label(a,image=B)
l.place(x=380,y=280)
l1=Label(a,text='Login/Sign Up',font=('algerian',22,"bold"),width=15,
height=2,bg="white",fg='black',bd=6,relief='ridge')
l1.pack()
l2=Label(a,image=D)
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 5/6
9/15/23, 6:31 PM Untitled3 - Jupyter Notebook

l2.place(x=20,y=50)
b1=Button(a,text='Login Here',font=('algerian',22,"bold"),width=11,height=1,bg="white",fg='blue',
bd=6,relief='ridge',activebackground='pink',command=login)
b1.place(x=420,y=100)
b2=Button(a,text='Sign Up',font=('algerian',22,"bold"),width=11,height=1,bg="white",fg='blue',
bd=6,relief='ridge',activebackground='pink',command=sign)
b2.place(x=720,y=100)
b3=Button(a,text='Quit',font=('algerian',22,"bold"),width=11,height=1,bg="white",fg='Green',
bd=6,relief='ridge',activebackground='pink',command=quit)
b3.place(x=580,y=180)
a.mainloop()

Welcome
Welcome
Welcome

In [ ]: ​

In [ ]: ​

localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 6/6

You might also like