login system python

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

showing results for - "login system python"
Sebastián
13 Nov 2016
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
Mildred
28 Aug 2020
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()
queries leading to this page
how to make a login system in python for begginerslogin system in pythonpython how to make a login systempython login applicationlogin python gethow to make simple login in pythonsimple login for pythonget login pythonlogin system python 3simple login system using puthonhow to make login system in python basic login system pythonlogin program in pythonlogin python code python 3python login functionpython package for login systempython simple login systemlogin 28 29 pythonlogatithm in pythonpython login window examplepython login examplehow to make a login system in pythonpytthon login system program codepython login fcclog system information in pythonlogin python request examplelogin system python with server and clienthow to log in pythonpython login programlogin pythonhow to get login pythonlogin python programcreating a login system in pythonpython login and register systempython loguruhow to mannage log system pythonsimple login system for pythonlogin system in python code log oin pythonpython login system source codelogin system python guisimple login system pythonlog into with python login in pythonlogin system pythonloggin python login pylogin form pythonlog in pythonhow to make a login and username in pythonlogin page in pythonpython login documentlogin system with pythonpython login codeloginmanager pythonsimple python login systemlogin library pythonpython login modulepython login classa python login in system programlogin using pythonwhich method we use for login function in pythonlogin using the os module in pythonpython login system serverlogin via pythonpython login and register system oopsimple login system python 3 4 2login python request examplepython login systemlogin with pythonpython login system codepython loginlogarithm in pythonlogin system using pythonpython login pagewindows login with pythonpython login code 5cpython login libraryhow to create a login system in pythonhow to make a login system in python for beginnerspython user login systempython login system websitepython basic login systempython logarithm functionlog in python without mathhow to create a login system with pythonlogin script in pythonlogin def pylogin using python3secure login system with pythonget login windows pythonpython logarithmloguru pythonlogin system phytonmake a login system pythonlogin info in woindows pythonsimple login form in pythonlogin system python