Python Project
Python Project
connector as my
m=my.connect(host="localhost",user="root",passwd="",database="lps",charset="utf8")
######################################
def push():
cur=m.cursor()
x=search_exist(r)
if x==1:
return
cur.execute(st)
m.commit()
####################################
def search():
cur=m.cursor()
cur.execute(st)
da=cur.fetchall()
for r in da:
print(r)
####################################
def dele(p):
x=search_exist(p)
if x==0:
return
cur=m.cursor()
cur.execute(st)
m.commit()
#############################################
def display():
cur=m.cursor()
cur.execute(st)
da=cur.fetchall()
for j in da:
print(j)
####################################
####################################
def search_exist(r):
cur=m.cursor()
cur.execute(st)
da=cur.fetchall()
for j in da:
if j[0]==r:
return 1
return 0
####################################
i=1
while i==1:
x=int(input("Enter ur choice"))
if x==1:
push()
elif x==2:
search()
elif x==3:
dele(d)
elif x==4:
display()
elif x==5:
break
#################################