You are on page 1of 3

import mysql.

connector

mydb=mysql.connector.connect(host="localhost",user="root",passwd="akanksh12")

mycur=mydb.cursor()

mycur.execute("create database translate")

mydb=mysql.connector.connect(host="localhost",user="root",passwd="akanksh12",database="translat
e")

mycur=mydb.cursor()

mycur.execute("create table meaning(english varchar(15),german varchar(15))")

import module1

while True:

print("\t\t\t\t TRANSLATOR")

print("\t\t\t\t ENGLISH-GERMAN")

print("*"*128)

print("1.Translate")

print("2.Add word")

print("3.Display all word")

print("4.change word meaning")

print("5.Delete word")

print("6.exit")

c=input("enter choice:=> ")

if c=="1":

print("*"*128)

print("1.English to German")

print("2.German to English")

ch=input("Enter choice:=> ")

if ch=="1":
module1.enger()

else:

module1.gereng()

elif c=="2":

print("*"*128)

print("1.Add english word")

print("2.Add german word")

ch=input("enter choice:=> ")

if ch=="1":

module1.addeng()

else:

module1.addger()

elif c=="3":

print("*"*128)

module1.dispall()

elif c=="4":

print("*"*128)

print("1.Change english word")

print("2.Change german word")

ch=input("Enter choice:=> ")

if ch=="1":

module1.changeng()

else:

module1.changer()

elif c=="5":
print("*"*128)

module1.delwor()

elif c=="6":

print("Thank you for using translator")

break

else:

print("Wrong choice,enter again")

pass

You might also like