Skip to content

Feature Request: Add Support for Multi-directory Selection in tkinter.filedialog.askdirectory #129136

@Florian-Mangold

Description

@Florian-Mangold

Feature or enhancement

Proposal:

# Add a code block here, if required

Dear Python Developers,

I would like to propose a new feature for the tkinter.filedialog.askdirectory method: adding an option to allow users to select multiple directories in a single dialog.

Currently, tkinter.filedialog.askdirectory only supports selecting a single directory. While askopenfilenames provides multi-file selection, there is no straightforward way to enable the selection of multiple directories without significant workarounds (e.g., manually adding directories one by one or creating a custom GUI).

Proposed Solution:
Introduce a parameter, such as multiple=True, to askdirectory that allows users to select multiple directories. This behavior could be similar to askopenfilenames, where users can toggle multiple selections via the file dialog interface.

Benefits:
It simplifies workflows for applications requiring multiple directory paths.
It reduces the need for custom workarounds and enhances developer experience.
It aligns with the functionality already available for multi-file selection.

Use Case:
For example, developers creating applications that process files across multiple directories or backup tools that work with multiple folder paths would benefit greatly from this feature.

Example API:
directories = filedialog.askdirectory(title="Select Directories", multiple=True)

I understand that this feature may depend on underlying platform-specific libraries, such as tk.

This is the first time I am submitting a feature request to the Python developers, so I hope this is the right place for an improvement like this. Please let me know if it should be redirected elsewhere or if I need to provide additional details.

Thank you for considering this feature request.

Best regards,
Florian Mangold

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions