-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathww.py
More file actions
52 lines (52 loc) · 1.64 KB
/
Copy pathww.py
File metadata and controls
52 lines (52 loc) · 1.64 KB
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
42
43
44
45
46
47
48
49
50
51
52
##########Project###########
from tkinter import *
from tkinter import ttk
root = Tk()
root.title('ebi')
root.geometry("400x400")
root.config(bg='gray25')
#ali=PhotoImage(file='a.png')
#root.iconphoto(True,ali)
#ai=PhotoImage(file='rt.png')
combo = ttk.Combobox(root, values=['en','fa', 'es', 'fr', 'de'])
combo.place(x=130, y=150)
combo2 = ttk.Combobox(root, values=['en','fa', 'es', 'fr', 'de'])
combo2.place(x=130, y=225)
u = StringVar()
u.set(None)
l = Label(root, text='from :', bg='gray25', fg='snow')
l.place(x=130, y=120)
l2 = Label(root, text='to :', bg='gray25', fg='snow')
l2.place(x=130, y=200)
t = Text(root, width=13, height=7)
t.place(x=15, y=130)
e = Text(root, width=13, height=7)
e.place(x=280, y=130)
pas = Label(root, text='option :', bg='gray25', fg='snow')
pas.place(x=285, y=250)
w2 = Radiobutton(root, text='Listening', bg='gray25', variable=u, value='Listening')
w2.place(x=327, y=249)
#import pyttsx3
#engine = pyttsx3.init()
#a=input("bde:")
#engine.say(a)
#engine.runAndWait()
def read():
text1 = t.get('1.0', END)
job = combo.get().strip() or 'en'
job2 = combo2.get().strip() or 'fa'
voice=u.get()
print(text1)
print(job)
print(job2)
print(voice)
from deep_translator import GoogleTranslator
a = GoogleTranslator(source= job, target=job2).translate(text1)
print(a)
e.delete('1.0',END)
e.insert(INSERT,a)
l = Label(text = a)
kk = Button(root,text='submit',font=('arial',20) ,bg='black', fg='snow',activebackground='black',command=read)
#,activeforeground='snow',state=ACTIVE,image=ai,compound=LEFT)
kk.place(x=170, y=300)
root.mainloop()