-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainfile.py
35 lines (26 loc) · 1.09 KB
/
mainfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from tkinter import messagebox
import splash
import pymysql
import login
import createadmin
class MainClass:
def __init__(self):
try:
mydatabaseobj = pymysql.connect(host="localhost", user="root", password="",
db="office")
try:
with mydatabaseobj.cursor() as myconn:
myconn.execute("select * from usertable")
myresultdata = myconn.fetchone()
if myresultdata is not None:
splash.splash()
#login.login()
else:
createadmin.CreateAdmin()
except Exception as ex:
messagebox.showerror("Error Occured", "Error in fetching due to " + str(ex))
finally:
mydatabaseobj.close()
except Exception as ex:
messagebox.showerror("Error Occured", "Error creating database due to " + str(ex))
MainClass()