Skip to main content

pytinyfiledialogs

Native OS dialogs for Python: message box, file open and save, folder picker, input box, color chooser, notification, and beep.

No Qt. No Tk. No GUI toolkit. It is a thin ctypes wrapper around tinyfiledialogs v3.22.1, so the dialogs look like your system dialogs on Linux, macOS, and Windows.

Install

pip install pytinyfiledialogs

The wheel contains the compiled library for all three platforms. The right one is picked at import time.

Python 3.8 or newer.

Usage

import pytinyfiledialogs as tfd
Function Returns
message_box(title, message, dialog_type="ok", icon_type="info") 1 yes/ok, 0 no or cancel, 2 no in yesnocancel
notify_popup(title, message, icon_type="info") 1
input_box(title, message, default_input="") text, or None on cancel
open_file_dialog(title, default_path="", filters=None, filter_description=None, allow_multiple=False) path, or list of paths when allow_multiple=True, or None on cancel
save_file_dialog(title, default_path="", filters=None, filter_description=None) path, or None on cancel
select_folder_dialog(title, default_path="") path, or None on cancel
color_chooser(title, default_hex_rgb="", default_rgb=(0, 128, 255)) "#RRGGBB", or None on cancel
beep() nothing

dialog_type is one of ok, okcancel, yesno, yesnocancel. icon_type is one of info, warning, error, question.

Pick a file

path = tfd.open_file_dialog(
    title="Pick an image",
    filters=["*.png", "*.jpg"],
    filter_description="Images",
)
print(path)  # "/home/me/cat.png", or None

With allow_multiple=True, the return value is a list of paths:

paths = tfd.open_file_dialog(filters=["*.txt"], allow_multiple=True)
if paths is not None:
    for path in paths:
        print(path)

None means the dialog was canceled. A single selected file still comes back as a one-item list.

On Linux and macOS a filename may contain |. The underlying library joins selections with | and offers no escape, so such a file can be split into two paths.

Ask for text

name = tfd.input_box("Your name", "Type it below")

# default_input=None gives a password box (characters are hidden)
password = tfd.input_box("Password", "", default_input=None)

Choose a save path

path = tfd.save_file_dialog(
    title="Save report",
    default_path="report.txt",
    filters=["*.txt"],
    filter_description="Text files",
)

The save dialog returns a path; your code must write the file.

Message box

answer = tfd.message_box("Confirm", "Continue?", dialog_type="yesno")
if answer == 1:
    print("Yes")

For yesnocancel, the results are 1 (Yes), 2 (No), and 0 (Cancel).

Other dialogs

folder = tfd.select_folder_dialog("Choose a folder")
color = tfd.color_chooser("Choose a color", default_hex_rgb="#0080FF")
tfd.notify_popup("Finished", "Your report is ready")
tfd.beep()

Notes

  • Filters are glob patterns, like *.png, not descriptions. They only control which files the dialog shows. They are not a security check.
  • Quotes are rejected. The C library refuses " in titles and filter descriptions. Avoid them, or the dialog shows an error text instead.
  • Linux needs a dialog backend. Install zenity or kdialog. Without one, the library falls back to a terminal prompt or a plain input prompt.
  • macOS and Windows need nothing extra. They use native dialogs.

Build from source

Needed for local development. make builds only the library for your own OS.

git clone https://github.com/ippokrates/pytinyfiledialogs
cd pytinyfiledialogs
make
python3 -c "import pytinyfiledialogs as t; print(t.tfd.tinyfd_messageBox)"

The release wheel needs Linux, macOS, and Windows binaries, so it is built by GitHub Actions, not locally.

Releasing

pyproject.toml and the tag must match: version = "2.0.0" and v2.0.0.

git tag v2.0.0
git push origin v2.0.0

That starts the workflow. It builds all three binaries, makes one wheel, and creates the GitHub Release with the wheel attached.

Do not click "Draft a new release" on GitHub. The workflow creates the release, and a second one fails with "release already exists".

License

Zlib. See LICENSE.

Built on tinyfiledialogs v3.22.1 by Guillaume Vareille, also under the Zlib license.

Metadata

Release files for pytinyfiledialogs 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pytinyfiledialogs 2.0.0
File Interpreter ABI Platform Actions
pytinyfiledialogs-2.0.0-py3-none-any.whl Python 3 none any Details for pytinyfiledialogs-2.0.0-py3-none-any.whl

Release files / pytinyfiledialogs-2.0.0-py3-none-any.whl

Download URL pytinyfiledialogs-2.0.0-py3-none-any.whl
Size 171.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
540d6815dd7d90a5798a3e934e2827c91a0c30e23c187b436adc2c7843b0d1b8
BLAKE2b-256 checksum
How to use checksums
c73d5055e4d9f4c347dfe29d2b1a66b600e5a8ac246753e8c63ff01609f09c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for pytinyfiledialogs 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for pytinyfiledialogs-2.0.0-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page