-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphic.py
More file actions
156 lines (76 loc) · 2.53 KB
/
Copy pathgraphic.py
File metadata and controls
156 lines (76 loc) · 2.53 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import customtkinter
from tkinter import filedialog
import os
from mp3 import *
class App(customtkinter.CTk):
def __init__(self):
super().__init__()
self.wm_title("Danscot_converter")
self.geometry("600x400")
self.minsize(600, 400)
self.maxsize(600, 400)
self.file_path = str
self.file_name = str
self.generic_heading = customtkinter.CTkLabel(
master=self,
text="D a n s c o t M P 3 C o n v e r t e r",
text_color="white",
font=("Calibri", 22),
)
self.path = customtkinter.StringVar()
self.home_page()
def home_page(self):
self.generic_heading.pack(pady=20)
# file selction button
customtkinter.CTkButton(
master=self,
text="select a file to convert to audio",
corner_radius=10,
font=("calibri", 16),
width=160,
command=self.view_file,
hover_color="#9748FF",
background_corner_colors=None,
fg_color='#9748FF'
).place(x=80, y=120)
customtkinter.CTkButton(
master=self,
text="select a directory to save the file",
corner_radius=10,
font=("calibri", 16),
width=160,
command=self.get_directory,
hover_color="#9748FF",
background_corner_colors=None,
fg_color='#9748FF'
).place(x=80, y=210)
# convert button
customtkinter.CTkButton(
master=self,
text="C O N V E R T",
corner_radius=10,
font=("calibri", 20),
width=160,
command=self.converter,
hover_color="#9748FF",
background_corner_colors=None,
fg_color='#9748FF',
).place(x=220, y=330)
def file_data(self):
self.file_name = os.path.splitext(os.path.basename(self.file_path))[0]
customtkinter.CTkLabel(
master=self,
text=f'F I L E N A M E : {self.file_name}',
text_color="white",
font=("Calibri", 16),
).place(x=100, y=170)
def view_file(self):
self.file_path = filedialog.askopenfilename()
self.file_data()
def get_directory(self):
self.dir_path = filedialog.askdirectory()
def converter(self):
mp3 = Mp3(self.file_path, self.dir_path)
mp3.convert_to_audio()
test = App()
test.mainloop()