!!! warning "Pre-2.0 layout"
This page describes the pre-2.0 flat main.py layout. As of 2.0.0 the library is the
programver package (VersionDialog, programver/dialog.py) and main.py is a demo,
not the module itself — see Known Issues for what changed and
the README for current usage. This
page is pending a rewrite for 2.0.
| Python | 3.x with Tkinter |
| Dependencies | None at runtime |
Tkinter is bundled on Windows and macOS; on Linux install python3-tk (Debian, Ubuntu) or
python3-tkinter (Fedora).
git clone https://github.com/willtheorangeguy/ProgramVer
cd ProgramVer
python main.pyYou will need to supply imgs/dfdlogo.gif, LICENSE.txt, and EULA.txt — see
Quickstart.
Resource paths are resolved against main.py's own location via get_resource_path, so the
working directory does not matter.
The intended use. Copy main.py into your project and import it:
from main import ProgramVer
ProgramVer()Copy imgs/ alongside it, or repoint the image paths.
Earlier documentation told you to copy ProgramVer.py and from ProgramVer import *. There is
no ProgramVer.py in this repository — the module is main.py, and the function inside it is
ProgramVer. Renaming the file to programver.py on the way in is reasonable, and then the old
instruction becomes true.
pip install programver
programverTwo caveats. The console script points at main:ProgramVer, which does call mainloop(), so it
would work — if the image were present. And the packaging declares imgs/ as the package root
(package_dir={"": "imgs"}, find_packages(where="imgs")) where there are no Python packages
at all; only py_modules=["main"] ships anything. See
internal/known-issues.md.
Attached to releases, built
with PyInstaller. Note that a one-file build unpacks to a temporary directory — get_resource_path
resolves against __file__, which PyInstaller sets appropriately, so this should hold.
python main.pyThe window appears with your logo. A TclError about dfdlogo.gif means the image is still
missing; see Troubleshooting.
pip install -r requirements.txt
pytest