Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to place a default file name in the file dialog asksaveasfile python

Tags:

python

tkinter

I would like to place a value in the file dialog by default when the user is saving a file. Anyone can advise the syntax of it ?

saveFilePath = fileDialog.asksaveasfile(mode='w', title="Save the file", defaultextension=".txt")

For example: NewFile should be filled in when the file dialog is open

like image 624
Jonathan Lam Avatar asked Dec 24 '22 02:12

Jonathan Lam


1 Answers

initialfile

as proposed by Bryan Oakley worked.

like image 94
Jonathan Lam Avatar answered Dec 25 '22 16:12

Jonathan Lam