def select(): root = rooter("Select", False) root.geometry("430x180+0+0") Select.Frame(root, File.Read("Words/Files.txt"), "Select").mainloop() #Clears ups the output file to avoid bugs with Create/Select global file with open("Output.txt", "r") as f: if (f.read().count(" ") > 0): with open("Output.txt", "w") as f: f.write(file.split(".")[0]) f.close()