--- id: tkinterdnd2 version: "0.6.2" license: unclear license_treatment: permissive maintenance: active --- # tkinterdnd2 — TkinterDnD2 is a python wrapper for George Petasis'' tkDnD Tk extension version 2 License: permissive · Maintenance: active · Downloads: 273.9K/mo ## What it is and what it does tkinterdnd2 is a Python wrapper around the tkDnD Tk extension that enables native drag-and-drop functionality in Tkinter applications. It allows you to register widgets as drop targets and bind handlers to receive dropped files or data, with support for Windows, macOS, and Unix. The package bundles precompiled tkDnD binaries and handles the low-level Tcl/Tk integration so you can use drag-and-drop in standard Tkinter code or integrate it into frameworks like PySimpleGUI and CustomTkinter that manage their own Tk root windows. The core workflow is straightforward: create a TkinterDnD.Tk() root (or call TkinterDnD.require() on an existing root), register widgets as drop targets using drop_target_register(), and bind a handler with dnd_bind() to process the dropped data. The package handles the quirk that dropped file paths arrive as a Tcl list string (with braces around paths containing spaces) rather than a Python list, providing a splitlist() utility to parse them correctly. Use it for: - Build a file picker UI where users drag files onto a listbox or input field instead of using a file dialog. - Create a batch file processor that accepts dropped files and queues them for processing. - Integrate drag-and-drop into a PySimpleGUI or CustomTkinter application without replacing the framework's root window. - Add native drag-and-drop to a cross-platform desktop tool that must work on Windows, macOS, and Linux. - Enable drag-and-drop in a Tkinter-based data entry form to accept dropped documents or images. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds native drag-and-drop support to Tkinter applications on Windows, macOS, and Unix by wrapping the tkDnD Tk extension. Yes, if you need native drag-and-drop in a Tkinter application and are willing to work with a Pre-Alpha package. The low install friction, permissive license, active maintenance, and zero known vulnerabilities make it a reasonable choice. The main caveat is the Pre-Alpha status—test thoroughly in your target environments before shipping, and verify that the bundled tkDnD binaries work on all platforms you support. ## Install pip install tkinterdnd2 uv add tkinterdnd2 poetry add tkinterdnd2 ## Installing tkinterdnd2 Before you install: Low install friction; pure Python wheel with no compiled dependencies to build. Actively maintained as of 2026-07-05 with recent release history. License in practice: MIT license permits commercial and private use with minimal restrictions; permissive treatment means you can use this in proprietary projects. Quickstart: pip install tkinterdnd2 import tkinter as tk from tkinterdnd2 import DND_FILES, TkinterDnD root = TkinterDnD.Tk() lb = tk.Listbox(root) lb.drop_target_register(DND_FILES) lb.dnd_bind('<>', lambda e: lb.insert(tk.END, root.tk.splitlist(e.data)[0])) lb.pack() root.mainloop() Requires Python 3.6 or later; tkDnD binaries are bundled but platform-specific behavior depends on native Tk/Tcl support on your OS. Verify before relying: - Whether tkDnD binaries are included for all three platforms (Windows, macOS, Unix) or if some require separate installation. - Compatibility with Python 3.12+ given the Pre-Alpha development status and Tcl 9 support claim. - Performance characteristics when handling large file drops or rapid drag-drop sequences. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 273.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tkinter drag and drop, native dnd support tkinter, file drop tkinter, tkdnd python wrapper, drag drop gui tkinter, cross-platform tkinter dnd, gui-toolkit, drag-drop, tkinter [View on SkillFed](https://skillfed.io/packages/tkinterdnd2) · [View on PyPI](https://pypi.org/project/tkinterdnd2/)