PyMsgBox
A simple, cross-platform, pure Python module for JavaScript-like message boxes.
What it is and what it does
PyMsgBox is a lightweight wrapper around native system dialogs that mimics JavaScript's message box API for Python. It provides four functions—alert, confirm, prompt, and password—each returning the user's choice or input. The package is pure Python with no external dependencies, making it simple to integrate into scripts and applications that need basic user interaction without a full GUI framework.
The module works cross-platform by delegating to the underlying system's dialog implementation. It supports Python 3.4 through 3.14, making it compatible with both older and current Python versions. The API is intentionally minimal and familiar to developers coming from JavaScript, reducing the learning curve for adding simple dialog boxes to command-line or desktop applications.
Use it for:
- Display confirmation dialogs in command-line tools before destructive operations
- Collect simple user input (names, passwords, settings) without building a full GUI
- Add alert notifications to scripts that need to pause and wait for user acknowledgment
- Create cross-platform desktop utilities that run on Windows, macOS, and Linux with native dialogs
- Prototype interactive applications quickly without learning a GUI framework
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyMsgBox provides JavaScript-like message box functions (alert, confirm, prompt, password) that work cross-platform in pure Python, displaying native dialog boxes for user interaction.
Yes, for simple dialog needs. PyMsgBox is worth installing if you need lightweight, cross-platform message boxes without GUI framework overhead. It has no runtime dependencies, installs easily, and works across Python 3.4–3.14. The aging maintenance status (last release 339 days ago) is not a blocker for stable, simple functionality, but verify Tkinter availability on your target platform before deploying.
Install
pymsgbox on PyPI
pip
pip install pymsgboxuv
uv add pymsgboxpoetry
poetry add pymsgboxInstalling PyMsgBox
Before you install
Installation is straightforward with no runtime dependencies. The package is aging (last release 339 days ago) but remains actively maintained; the repository is not archived and has received recent commits.
License in practice
PyMsgBox is licensed under a Modified BSD License (copyleft treatment). This is permissive for most uses but requires preservation of copyright and license notices in redistributions; commercial use is allowed.
Quickstart
pip install pymsgbox
from pymsgbox import alert, confirm, prompt
alert(text='Hello', title='Message')
response = confirm(text='Continue?', buttons=['Yes', 'No'])
user_input = prompt(text='Enter name:', defaultValue='')
On Linux with Python 2, Tkinter must be installed separately (sudo apt-get install python-tk); modern Python 3 versions typically include it.
Verify before relying
- Whether Tkinter is bundled or requires separate installation on macOS and Windows systems
- Performance characteristics when displaying many dialogs in sequence
- Accessibility support for screen readers or keyboard-only navigation
Package facts
| License | Copyright (c) 2014, Al Sweigart All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *… (full text in the JSON record) (copyleft) |
| Python support | supports the current Python release (>=3.4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 339 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,279,404/month — #2,123 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymsgbox-2.0.1-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
easyguiEasyGUI provides simple, non-event-driven GUI…
permissive · top 5,000 on PyPI
pwinputDisplays mask characters (like asterisks) as…
permissive · top 15,000 on PyPI
PyAutoGUIPyAutoGUI programmatically controls the mouse…
permissive · top 5,000 on PyPI
notify_pySends cross-platform desktop notifications from…
permissive · top 15,000 on PyPI
pythondialogProvides a Python interface to the UNIX dialog…
copyleft · top 15,000 on PyPI
PyWinBoxPyWinBox manages window positions, sizes, and…
permissive · top 15,000 on PyPI
pyperclipPyperclip provides simple cross-platform access…
permissive · top 1,000 on PyPI
pywinautoAutomate Microsoft Windows GUI interactions by…
permissive · top 5,000 on PyPI
pystrayPystray creates a system tray icon with an…
copyleft · top 5,000 on PyPI
desktop-notifierSends cross-platform desktop notifications from…
permissive · top 15,000 on PyPI