Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

windows_filedialogs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

windows_filedialogs

Simple Windows file dialogs.

  • 0.0.7
  • PyPI
  • Socket score

Maintainers
1

File dialogs for Windows

Coverage Status GitHub Workflow Status PyPI GitHub GitHub Last Commit GitHub Issues Downloads Python Version

pip install windows-filedialogs

Documentation: https://mrthearman.github.io/filedialogs/

Source Code: https://github.com/MrThearMan/filedialogs/

Contributing: https://github.com/MrThearMan/filedialogs/blob/main/CONTRIBUTING.md


Implements easy Windows file dialog functions. Requires the pywin32 module.

Basic use:

from filedialogs import save_file_dialog, open_file_dialog, open_folder_dialog

open_path = open_file_dialog()
if open_path:
    with open(open_path, "r") as f:
        ...

save_path = save_file_dialog()
if save_path:
    with open(save_path, "w") as f:
        ...

open_folder = open_folder_dialog()
if open_folder:
    with open(os.path.join(open_folder, ...), "w") as f:
        ...

Documentation:

open_file_dialog
  • title: str - Dialog title. Default is no title.
  • directory: str - Directory to open file dialog in. Default is the current working directory.
  • default_name: str - Default file name on dialog open. Default is empty.
  • default_ext: str - Default file extension on dialog open. Default is no extension.
  • ext: list[tuple[str, str | tuple[str, ...]]] - List of available extensions as (description, extension) tuples. Default is ("All files", "*").
  • multiselect: bool - Allow multiple files to be selected. Default is False.

Returns: Path to a file to open if multiselect=False. List of the paths to files which should be opened if multiselect=True. None if file open dialog canceled.

Raises: IOError - File open dialog failed.


save_file_dialog
  • title: str - Dialog title. Default is no title.
  • directory: str - Directory to open file dialog in. Default is the current working directory.
  • default_name: str - Default file name on dialog open. Default is empty.
  • default_ext: str - Default file extension on dialog open. Default is no extension.
  • ext: list[tuple[str, str | tuple[str, ...]]] - List of available extensions as (description, extension) tuples. Default is ("All files", "*").

Returns: Path file should be save to. None if file save dialog canceled.

Raises: IOError - File save dialog failed.


open_folder_dialog
  • title: str - Dialog title. Default is no title.
  • encoding: str - Encoding for the folder. Default is Latin-1.

Returns: Path to folder. None if no folder selected.


Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc