Answers for "how to make simple login in python"

0

python code for login page

CorrectUsername = surname[0:3] + firstname[0:3]

loop = 'true'
while (loop == 'true'):
    username = input("Please enter your username: ")
    if (username == CorrectUsername):
    	password = input("Please enter your password: ")
        if (password == CorrectPassword):
            print("Logged in successfully as ") + username
            loop = 'false'
        else:
            print "Password incorrect!"
    else:
        print "Username incorrect!"
Posted by: Guest on February-19-2021
0

login python

from tkinter import *
from functools import partial

def validateLogin(username, password):
	print("username entered :", username.get())
	print("password entered :", password.get())
	return

#window
tkWindow = Tk()  
tkWindow.geometry('400x150')  
tkWindow.title('Tkinter Login Form - pythonexamples.org')

#username label and text entry box
usernameLabel = Label(tkWindow, text="User Name").grid(row=0, column=0)
username = StringVar()
usernameEntry = Entry(tkWindow, textvariable=username).grid(row=0, column=1)  

#password label and password entry box
passwordLabel = Label(tkWindow,text="Password").grid(row=1, column=0)  
password = StringVar()
passwordEntry = Entry(tkWindow, textvariable=password, show='*').grid(row=1, column=1)  

validateLogin = partial(validateLogin, username, password)

#login button
loginButton = Button(tkWindow, text="Login", command=validateLogin).grid(row=4, column=0)  

tkWindow.mainloop()
Posted by: Guest on August-16-2021
1

how to make simple login in python

username = input(' enter your username: ')
if username == 'Put Your Username Here':#change this
   print("checking username")
   time.sleep(0.5)
   print("username is right") 
   password = input(' type your password: ')
   if password == 'Put Your Password Here':#change this
    time.sleep(0.5) 
   else:
    exit()
else:
 exit()
Posted by: Guest on June-10-2021

Code answers related to "how to make simple login in python"

Python Answers by Framework

Browse Popular Code Answers by Language