Skip to main content

a windows popup library

Project description

pywinpop

Windows popup helpers built with ctypes.

Features

  • info, warning, and alert message boxes
  • yes/no, yes/no/cancel, ok/cancel, and retry/cancel confirmations
  • single-line, password, and multiline text input dialogs
  • open file, save file, Explorer-style folder dialogs, plus date and date-time pickers
  • native color and font pickers
  • error/details dialog and a lightweight progress dialog object
  • value/result types for dialog results, colors, and fonts

Install

pip install pywinpop

For local development in this repository:

uv sync

Public API

The package exports these public symbols from pywinpop directly.

Message boxes and confirmation dialogs

  • show_info(message, title="Information") -> DialogResult
  • show_warning(message, title="Warning") -> DialogResult
  • show_alert(message, title="Alert") -> DialogResult
  • ask_yes_no(message, title="Question") -> bool
  • ask_ok_cancel(message, title="Confirm") -> bool
  • ask_yes_no_cancel(message, title="Question") -> DialogResult
  • ask_retry_cancel(message, title="Retry") -> DialogResult

File, folder, and value pickers

  • browse_for_file(...) -> Path | None
  • save_file(...) -> Path | None
  • browse_for_folder(title="Select a folder") -> Path | None
  • pick_date(...) -> date | None
  • pick_datetime(...) -> datetime | None
  • pick_color(initial_rgb=0x000000) -> ChosenColor | None
  • pick_font(...) -> ChosenFont | None

Custom dialogs

  • input_box(...) -> str | None
  • input_password(...) -> str | None
  • input_multiline(...) -> str | None
  • show_error_details(message, *, details, title="Error Details") -> DialogResult
  • ProgressDialog(...)

Exported types

  • DialogResult
  • ChosenColor
  • ChosenFont
  • ProgressDialog

Example

from pywinpop import ProgressDialog
from pywinpop import ask_ok_cancel
from pywinpop import ask_yes_no
from pywinpop import browse_for_file
from pywinpop import browse_for_folder
from pywinpop import input_box
from pywinpop import input_multiline
from pywinpop import input_password
from pywinpop import pick_color
from pywinpop import pick_date
from pywinpop import pick_datetime
from pywinpop import pick_font
from pywinpop import show_alert
from pywinpop import show_error_details
from pywinpop import show_info
from pywinpop import show_warning

show_info("Backup completed.")
show_warning("This action cannot be undone.")
show_alert("A fatal error occurred.")

if ask_yes_no("Do you want to continue?"):
    name = input_box("Enter your name:", default="Richard")
    password = input_password("Enter your password:")
    notes = input_multiline("Enter notes:", default="Line 1")
    chosen_file = browse_for_file(title="Select a document")
    chosen_folder = browse_for_folder(title="Select an output folder")
    chosen_date = pick_date(title="Select a due date")
    chosen_datetime = pick_datetime(title="Select a reminder")
    chosen_color = pick_color(initial_rgb=0x336699)
    chosen_font = pick_font(initial_face_name="Segoe UI", initial_point_size=10.0)

    if ask_ok_cancel("Show a details dialog?"):
        show_error_details(
            "The backup failed.",
            details="Raw Win32 or traceback details can go here.",
        )

    with ProgressDialog(title="Example Progress", message="Working") as dialog:
        dialog.set_progress(1, total=3)

    print(
        name,
        password,
        notes,
        chosen_file,
        chosen_folder,
        chosen_date,
        chosen_datetime,
        chosen_color,
        chosen_font,
    )

See example.py in the repository for a fuller interactive walkthrough.

Notes

  • This package is Windows-only.
  • The dialogs use Win32 APIs through ctypes rather than external GUI frameworks.
  • ProgressDialog is modeless; call set_message, set_progress, or pump during long-running work so it stays responsive.
  • The folder picker uses the standard file-open dialog with Win32 control manipulation to present an Explorer-style folder selection flow.

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

pywinpop-2026.5.5.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywinpop-2026.5.5.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file pywinpop-2026.5.5.0.tar.gz.

File metadata

  • Download URL: pywinpop-2026.5.5.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pywinpop-2026.5.5.0.tar.gz
Algorithm Hash digest
SHA256 a769e2e1d260a75710f4127aa7e2e07673f99ac09e17bd80a1793248b6052d1c
MD5 64726849c6de8646e3574c7517492187
BLAKE2b-256 568869ff865dce6a3807275483fd3aaec0143289ab6cbcc0dd86c9dddebffc41

See more details on using hashes here.

File details

Details for the file pywinpop-2026.5.5.0-py3-none-any.whl.

File metadata

  • Download URL: pywinpop-2026.5.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pywinpop-2026.5.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bab8fd00f9537d84fe90dc6eda4db43110d4d1167a8799201ecd6602861cb67d
MD5 210c627f28dc360ffc90db98a8d7e254
BLAKE2b-256 d4e74ff59c0aa26fd9be785695cf5d0e3f9cf2a4c807496efb0a11c8b49bc4d4

See more details on using hashes here.

Supported by

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