Simple Windows file dialogs.
Project description
File dialogs for Windows
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
Built Distribution
File details
Details for the file windows_filedialogs-0.0.6.tar.gz
.
File metadata
- Download URL: windows_filedialogs-0.0.6.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b2b725d72b0037ec71aad3ae7957ce1f984767971228ef66a9071384d81d4f |
|
MD5 | 68121d6848bde902193888c783f928f7 |
|
BLAKE2b-256 | 1860cc559c8107788b82d2082f5660e178690da7c899372d999a8ceef81890e2 |
File details
Details for the file windows_filedialogs-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: windows_filedialogs-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf6b47f429943ee5bbcaac0e2825e1045577b017db2f282e58684ef62780ccc |
|
MD5 | 36a0bcbae093502fe9245dcd24d8f8cf |
|
BLAKE2b-256 | 2445b90a6b8373ad4fc554d96e45f370f3e331f4a8354e72b50d82927c06f3a7 |