To create login program in python

Tanuj_2

Login program

775 Views
About the Author
class Login:
    error = None
    def __init__(self, uid, passw):
        self.uid = "abc"
        self.passw = "123"
        Login.error = "Enter a valid user id and password"
        
    def authenticate(self):
        if (self.uid == logid and self.passw == logpass):
            print ("Login successful")
        else:
            print (Login.error)
            
log = Login("", "")
logid = input("Enter your user ID: ")
logpass = input("Enter your password: ")

log.authenticate()
rproffitt 1,997 "Nothing to see here." Moderator

I hope you realize this is a prime example of a bad login system. It's a fairly safe bet the data is in the clear.

Never teach this old method ever again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.