Skip to content

Instantly share code, notes, and snippets.

Created Sep 25, 2020
What would you like to do?
def open_file():
"""Open a file for editing."""
filepath = askopenfilename(
filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")]
if not filepath:
txt_edit.delete("1.0", tk.END)
with open(filepath, "r") as input_file:
text =
txt_edit.insert(tk.END, text)
window.title(f"Thecleverprogrammer - {filepath}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment