I\'ve spent some time to search for workable solution to do Drag and Drop behavior with Python Tkinter on OSX platform, and the most possible solution found is TkDnD library
I spent a few days to figured out how to install TkDnD lib, although it sounds like an easy question but did confused me a little while.
Two ways to install TkDnD on OSX:
A. Copy to /System/Library/Tcl/8.x:
OSX preinstalled Python already, and this is the path where Tcl library is installed. TkDnd lib will be loaded automatically while using Tk/Tcl lib.
B. Set os.environ['TKDND_LIBRARY'] to the location of TkDnd2.x.dylib:
Sample code:
if sys.platform == 'win32':
if getattr(sys, 'frozen', False):
os.environ['TKDND_LIBRARY'] = os.path.join(os.path.dirname(sys.executable), 'tkdnd2.7')