Skip to main content

Simple Windows file dialogs.

Project description

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/


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

Basic use:

from filedialogs import save_file_dialog, open_file_dialog, open_folder_dialog

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

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

openfolder = open_folder_dialog()
if openfolder:
    with open(os.path.join(openfolder, ...), "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]] - 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]] - 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.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windows_filedialogs-0.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

windows_filedialogs-0.0.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file windows_filedialogs-0.0.5.tar.gz.

File metadata

  • Download URL: windows_filedialogs-0.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.13 Windows/10

File hashes

Hashes for windows_filedialogs-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a9aa5739a0ab344c754720b43e0f3635a299dbac435be70d300b4d4da911e634
MD5 532cf65ad7297c13c56890c5a87cccc7
BLAKE2b-256 3e76182222a692dc3eca2b73ba4ae8ea82e0a4cbddc649d0085d12244cb547da

See more details on using hashes here.

File details

Details for the file windows_filedialogs-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for windows_filedialogs-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cda0b6e7ccc5867cfb18ddfea67e825a6c1a5fa576d3a59be27620e1b30a8c17
MD5 0d16a1850a9fb0978bba564c997a206a
BLAKE2b-256 83a18e6287002d1c7a4e1d47dd14a878de44d448688f2010c13ce836d8dfb190

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page