Home > Software design >  How to let a user save a file in a directory?
How to let a user save a file in a directory?

Time:08-08

I am trying to create a "save as" button using tkinter. For that, I want to let the user choose a directory and a name for the file. The file will be a dictionary converted into a json file. I understand that I can create a browse button for it using filedialog.askdirectory but the problem is, I dont know how can I let the user choose the name of his save file. Does anyone know how to do that?

CodePudding user response:

You can use filedialog.asksaveasfilename().

  • Related