To create login program in python

Tanuj_2 0 Tallied Votes 973 Views Share

Login program

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 2,580 "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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.