Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- from tkinter import messagebox
- window = tkinter.Tk()
- window.title('Sign-in Page')
- window.iconbitmap('C:\Users\neel-_000DownloadsIconshock-Cms-User-login.ico')
- window.geometry("1200x1200")
- window.configure(background='#0B4C5F')
- labelfont = ('times', 20, 'bold')
- user_info = []
- def callback():
- username_2 = username_0.get()
- if not username_2.isalpha() or len(username_2) < 1:
- username = tkinter.Label(text=" Invalid Username", font=('Times New Roman', 12), anchor='center').pack()
- error_message = tkinter.Label(text=" Please Restart Program to Retry").pack()
- import time
- time.sleep(0.5)
- print("Username not accepted")
- not_accepted = tkinter.Label(text='Username has not been accepted, close program and retry')
- else:
- label = tkinter.Label(text= 'Welcome ' + username_2 + ' ! It is good to see you')
- label.pack()
- user_info.append(username_2)
- print("username excepted")
- password_ref = password_0.get()
- if len(password_ref) < 1:
- username = tkinter.Label(text=" Invalid Password", font=('Times New Roman', 12), anchor='center').pack()
- error_message = tkinter.Label(text=" Please Restart Program to Retry").pack()
- import time
- time.sleep(0.5)
- print("Password not accepted")
- pass_not_accepted = tkinter.Label(text='Password has not been accepted, close program and retry')
- else:
- user_info.append(password_ref)
- print("password excepted")
- return callback
- username = tkinter.Label(text="Username", font=('Times New Roman', 12), height=1, width=15)
- username_0 = tkinter.Entry(window, font=("Times",14))
- username.pack()
- username.place(x=535, y=271)
- username_0.pack()
- username_0.place(x=510, y=310, height=25, width=200)
- password = tkinter.Label(text='Password', font=('Times New Roman', 12), height=1, width=15)
- password_0 = tkinter.Entry(window, show='*', font=('Times', 14))
- password.pack()
- password.place(x=535, y=360)
- password_0.pack()
- password_0.place(x = 510, y = 400, height=25, width=200)
- button = tkinter.Button(text="Sign In", fg='#0B4C5F', bg='White', command=callback, activebackground="Black",
- activeforeground= "white", cursor="circle")
- button.flash()
- button.pack()
- button.place(x=530, y = 450, height=45, width=150)
- keep_sign_in = tkinter.Checkbutton(window,text="Keep me logged in")
- keep_sign_in.pack()
- keep_sign_in.place(x=510, y=500, height=50, width=200)
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement