login python

Solutions on MaxInterview for login python by the best coders in the world

showing results for - "login python"
Marco
05 May 2017
1import tkinter as tk
2import mysql.connector 
3from tkinter import *
4
5
6def submitact():
7	
8	user = Username.get()
9	passw = password.get()
10
11	print(f"The name entered by you is {user} {passw}")
12
13	logintodb(user, passw)
14
15
16def logintodb(user, passw):
17	
18	# If paswword is enetered by the 
19	# user
20	if passw:
21		db = mysql.connector.connect(host ="localhost",
22									user = user,
23									password = passw,
24									db ="College")
25		cursor = db.cursor()
26		
27	# If no password is enetered by the
28	# user
29	else:
30		db = mysql.connector.connect(host ="localhost",
31									user = user,
32									db ="College")
33		cursor = db.cursor()
34		
35	# A Table in the database
36	savequery = "select * from STUDENT"
37	
38	try:
39		cursor.execute(savequery)
40		myresult = cursor.fetchall()
41		
42		# Printing the result of the
43		# query
44		for x in myresult:
45			print(x)
46		print("Excecuted successfully")
47		
48	except:
49		db.rollback()
50		print("Error occured")
51
52
53root = tk.Tk()
54root.geometry("600x600")
55root.title("LOGIN SYSTEM PYTHON-ANSWER")
56
57
58# Definging the first row
59lblfrstrow = tk.Label(root, text ="USER ID ->", )
60lblfrstrow.place(x = 50, y = 20)
61
62Username = tk.Entry(root, width = 35)
63Username.place(x = 150, y = 20, width = 100)
64
65lblsecrow = tk.Label(root, text ="Password ->")
66lblsecrow.place(x = 50, y = 50)
67
68password = tk.Entry(root, width = 35)
69password.place(x = 150, y = 50, width = 100)
70
71submitbtn = tk.Button(root, text ="Login", 
72					bg ='blue', command = submitact)
73submitbtn.place(x = 150, y = 135, width = 55)
74
75root.mainloop()
76
Lucia
28 Apr 2016
1from tkinter import *
2from functools import partial
3
4def validateLogin(username, password):
5	print("username entered :", username.get())
6	print("password entered :", password.get())
7	return
8
9#window
10tkWindow = Tk()  
11tkWindow.geometry('400x150')  
12tkWindow.title('Tkinter Login Form - pythonexamples.org')
13
14#username label and text entry box
15usernameLabel = Label(tkWindow, text="User Name").grid(row=0, column=0)
16username = StringVar()
17usernameEntry = Entry(tkWindow, textvariable=username).grid(row=0, column=1)  
18
19#password label and password entry box
20passwordLabel = Label(tkWindow,text="Password").grid(row=1, column=0)  
21password = StringVar()
22passwordEntry = Entry(tkWindow, textvariable=password, show='*').grid(row=1, column=1)  
23
24validateLogin = partial(validateLogin, username, password)
25
26#login button
27loginButton = Button(tkWindow, text="Login", command=validateLogin).grid(row=4, column=0)  
28
29tkWindow.mainloop()
Sara
08 Mar 2020
1username = input(' enter your username: ')
2if username == 'Put Your Username Here':#change this
3   print("checking username")
4   time.sleep(0.5)
5   print("username is right") 
6   password = input(' type your password: ')
7   if password == 'Put Your Password Here':#change this
8    time.sleep(0.5) 
9   else:
10    exit()
11else:
12 exit()    
Keri
12 May 2017
1class User:
2
3def __init__(self,username,password,basket):
4    self.username=username
5    self.password=password
6    self.basket=basket
7
Michela
08 Oct 2017
1    def Login(self):
2    while True:
3        username = raw_input('\nPlease log in by providing your user credentials \nUser Name :')
4
5        if (username == users[0]['username'] or username == users[1]['username']):
6            password = raw_input('Password : ')
7            if (password == users[0]['password'] or password == users[1]['password']):
8                print('Successfully logged in!')
9                print (
10                'Welcome,' + username + '! Please choose of the following options by entering the corresponding menu number.')
11                global LoggedUserName
12                LoggedUserName = username;
13                return True;
14                break;
15            else:
16                print('Your password is not correct. Please try again!')
17        else:
18            print ('Your username is not correct. Please try again!')
19
queries leading to this page
python log classpython site with loginpython loginpython user login systemlogin program in pythonlog in pythonlogin library pythonpython login scripthow to make a login system in pythonpython login librarymake a login project with pythonhow to make a login and username in pythonpython login code 5cwhat is login 28 29 pythonpython simple login systemhow to get login python log oin pythonmake login request using pythonpython basic login systempython login system codehow to create a login system in pythonmake login request pythonexample login in pythonpython logarithpython login page codea logarithm pythonhow to creae a login in python using oopcreate simple python loginsimple python loginlogin via pythoncan you make a login page with pythonpython login system websitewhich method we use for login function in pythonpython function for loginpython login codehow to create a simple login program in pythonlogin pythonpython login window examplelogin page using pythonimport logarithm pythonsimple login system python 3 4 2how to mannage log system pythonloguru pythonlog in python without mathlogin using python3how to creae a login in pythonpython login systempython login applicationpython how to make a login systempython simple loginhow to make a simple website wiht a login with pythonhow to add login functionality in python classcreate login form with pythonlogin system python guihow to create a login program in pythoncreate a login page in pythoncreate python login pagelogin pylogin page pythonpython login system source coderequest login pythonlogin using pythonlogin page code for pythonhow to make a login system in python for beginnerssimple python login systemlogin page in pythonloggin python python login system serverwindows login with pythoncode for login page pythonlogin info in woindows pythonsimple login page pythonbasic login system pythonloginmanager pythoncreate login page pythonlogin python request examplelogin form python codecreating a program for account login pythonhow to make a login system in python for begginerspython logarithmpython logurulogarithm in pythonpython login with instance of classlogin system in python codecreating a login system in pythonlogin script in pythonlogin system python with server and clientlogin system python 3python login and register systemwhat does class login do in pythonpython login examplehow to create login page using pythonlogin in pythonhow to make a working login program in pythonlogin method in pythonhow to make simple login in pythonsimple login system for pythonlogin with pythonpython code for login pagelogin website pythonpython login documentlogin system phytonpython logarithm functionwhat is a login pythonlogin using the os module in pythonpython login classlogin 28 29 pythonlogin system pythonuse python to launch a program and loginlogin python request examplelogatithm in pythonsimple login for pythoncode login pythonlogin system using pythonlogin system in pythonpython login fcchow to log in pythonpython login programlogin function pythoncreate login with pythonhow to make login system in python simple login system pythonsimple login form in pythonpython login functionpython login pagesimple login system using puthonlogin python getbasic login pythonpython login modulehow to make a login form in pythonlog system information in pythonpython package for login systemlogin python