Skip to content Skip to sidebar Skip to footer

How Can I Add A File Extension Using Tkinter?

I am trying to save a pickle dump to a .pkl file using Tkinter. I followed the documentation but when I save the file it has no extension. This is a snippet: root = tk.Tk() root.w

Solution 1:

You can specify defaultextension parameter:

filedialog.asksaveasfilename(defaultextension='.pkl')

Post a Comment for "How Can I Add A File Extension Using Tkinter?"