How to make new folder in askdirectory dialog?

python, tkinter

Solution

I wish Tkinter included a New Folder button on the Linux platform, but it doesn't seem to. The best I could do was to just type the new folder name in the text field, and then create the new folder after the dialog box closes.

def process_files(self):
    savedir = tkFileDialog.askdirectory(title='Select folder to save results')
    os.makedirs(savedir)
    # Now write some files into savedir.

Problem

In tkinter in python 3.4, how to create folder using askdirectory dialog? ``` from tkinter import filedialog filedialog.askdirectory(initialdir="/tmp/test") ``` This shows choos directory window, but cant see option to create new folder. For example, /tmp/test/new_folder. usually choose directory window have button to make new folder, but cant find option in tkinter.

Original source