-
Notifications
You must be signed in to change notification settings - Fork 0
/
video_converter_GUI.py
52 lines (31 loc) · 1.42 KB
/
video_converter_GUI.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
42
43
44
from tkinter import*
from tkinter import filedialog
from backend2 import*
import threading
class VideoConverterGUI():
def __init__(self):
self.mi_video = None
self.window = Tk()
self.window.title("video compresor whatsapp")
self.window.geometry("300x200")
self.boton1 = Button(text ="select video",bg="pale green", command = self.open_file, font = ("Arial Bold", 12))
self.boton1.pack(padx=10, pady=10)
self.boton2 = Button(text =" convert ", bg = "pale green", command = self.crear_hilo, font = ("Arial Bold", 12))
self.boton2.pack(padx=10, pady=10)
self.boton3 = Button(text =" stop ", bg = "pale green", command = self.terminar_hilo, font = ("Arial Bold", 12))
self.boton3.pack(padx=10, pady=10)
self.window.mainloop()
def open_file(self):
self.mi_video = filedialog.askopenfilename(initialdir = "/",title = "selecione video")
def crear_hilo(self):
#llamando_a_start = lambda: start(self.mi_video)
conversor = ConversorVideo(self.mi_video)
self.hilo1 = threading.Thread(target=conversor.start)
self.hilo1.start()
def terminar_hilo(self):
self.hilo1._stop() # este es una metodo no documentado que podria deprecarce
def inicio():
app = VideoConverterGUI()
return app
if __name__ == '__main__':
app = inicio()