Update Uptated-Prototype/PiperTTS-GUI-Test.py

This commit is contained in:
2025-12-09 14:07:38 -08:00
parent 17765b8d53
commit da52cb3b4e

View File

@@ -134,17 +134,10 @@ def PiperTTS_GUI_Get_Clipboard():
def PiperTTS_GUI_TextFile_Open(): def PiperTTS_GUI_TextFile_Open():
try: try:
Root_Window.filename = filedialog.askopenfilename(initialdir = "./",title = "Select file",filetypes = (("Text files","*.txt"),("all files","*.*"))) Root_Window.filename = filedialog.askopenfilename(initialdir = "./",title = "Select file",filetypes = (("Text files","*.txt"),("all files","*.*")))
print(Root_Window.filename)
if Root_Window.filename: if Root_Window.filename:
with open(Root_Window.filename) as f: with open(Root_Window.filename) as f:
try:
Cursor_Position = Input_Box.index(INSERT) Cursor_Position = Input_Box.index(INSERT)
except:
print("Fucked up on the first part.")
try:
Input_Box.insert(Cursor_Position, f.read()) Input_Box.insert(Cursor_Position, f.read())
except:
print("Fucked up on the 2nd part.")
else: else:
print("Canceled file dialog.") print("Canceled file dialog.")
except: except: