-
-
Save amankharwal/88d807e26a6dcab743a5179ef266a3d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_file(): | |
"""Save the current file as a new file.""" | |
filepath = asksaveasfilename( | |
defaultextension="txt", | |
filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")], | |
) | |
if not filepath: | |
return | |
with open(filepath, "w") as output_file: | |
text = txt_edit.get("1.0", tk.END) | |
output_file.write(text) | |
window.title(f"Thecleverprogrammer - {filepath}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment