From 4e8a83b3a22d5b8940166e39424a1e568e06eea6 Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Tue, 9 Dec 2025 14:02:00 -0800 Subject: [PATCH] Update Uptated-Prototype/PiperTTS-GUI-Test.py --- Uptated-Prototype/PiperTTS-GUI-Test.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Uptated-Prototype/PiperTTS-GUI-Test.py b/Uptated-Prototype/PiperTTS-GUI-Test.py index 4a4c873..d8e0e8d 100644 --- a/Uptated-Prototype/PiperTTS-GUI-Test.py +++ b/Uptated-Prototype/PiperTTS-GUI-Test.py @@ -135,12 +135,16 @@ def PiperTTS_GUI_TextFile_Open(): try: Root_Window.filename = filedialog.askopenfilename(initialdir = "./",title = "Select file",filetypes = (("Text files","*.txt"),("all files","*.*"))) print(Root_Window.filename) - print(type(Root_Window.filename)) if Root_Window.filename: with open(Root_Window.filename) as f: - print(f.read()) - Cursor_Position = Input_Box.index(INSERT) - Input_Box.insert("Cursor_Position", f.read()) + try: + Cursor_Position = Input_Box.index(INSERT) + else: + print("Fucked up on the first part.") + try: + Input_Box.insert("Cursor_Position", f.read()) + else: + print("Fucked up on the 2nd part.") else: print("Canceled file dialog.") except: