-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshell.py
41 lines (36 loc) · 981 Bytes
/
shell.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
36
37
38
39
40
41
import os
import mysql.connector
os.system('cls')
print('Welcome to Suitor')
user = input("Enter Username: ")
password = input("Enter Password: ")
mydb = mysql.connector.connect(
host="suitor.czjiaq8hoddl.us-east-2.rds.amazonaws.com",
user=user,
password=password,
database='suitor'
)
while True:
cursor = mydb.cursor()
cursor.execute("Select * from Against;")
data = cursor.fetchall()
for d in data:
print(d)
print("Want to continue as the same user? Press 1, to change user 2, else 3")
c = int(input())
if c==1:
continue
elif c==2:
user = input()
password = input()
mydb.disconnect()
mydb = mysql.connector.connect(
host="suitor.czjiaq8hoddl.us-east-2.rds.amazonaws.com",
user=user,
password=password,
database='suitor'
)
continue
else:
mydb.disconnect()
exit()