I created my first python GUI using tkinter library, all goes smoothly except when I want to save the file.
The app basically opens a word document, edit some text then save the edited file. It saved perfectly with the code below:
file_name = "{}".format(save_entry.get())
save_filename = file_name + '.docx'
word_document.save(save_filename)
But I wanted to use askopenfilename, as it enables me to specify the file location.
Here is my attempt, using the argument initialfile, it saves an empty doc file, not the edited one.
filedialog.asksaveasfile(initialfile=word_document.save(save_filename), filetypes=[("Word Document Files", "*.docx"), ("All Files", "*.*")])