How to Drag and Drop External Files into Tkinter (using TkinterDND WITHOUT openfiledialog)
Why Stack Overflow recommends it
Stack Overflow users link it when they are trying to set up tkinterdnd2 or tkdnd and need a walkthrough of getting file drag and drop working in Tkinter.
Recommended by 0 people across 0 different months, 2021 to 2022.
What it is
A 14-minute Python tutorial showing how to add drag and drop of external files, such as from Windows Explorer, directly into a Tkinter window using TkinterDnD2 and the tkdnd library, without opening a file dialog. It walks through installing the libraries and wiring up the drop handler, building on a Stack Overflow answer.
What people said
Cites HappyLemon · 2021-08 · Stack Overflow · on “*.py script with tkinterdnd2 module doesn`t compile to an executable file”
I made an app that uses tkinter and tkinterdnd moudles. It works completely fine when I launch it as a script, however when I try to make and executable file from it and laucnh it, foloowing error ocures: Traceback (most recent call last): File "TkinterDnD2\TkinterDnD.py", line 53, in _require _tkinter.TclError: can't find package tkdnd During handling of the above exception, another exception occurred: Traceback (most recent call last): File "IxcomGUI.py", line 128, in <module> File "IxcomGUI.py", line 11, in __init__ File "TkinterDnD2\TkinterDnD.py", line 285, in __init__ File "TkinterDnD2\TkinterDnD.py", line 55, in _require RuntimeError: Unable to load tkdnd library. [14512] Failed to ex
Cites ahmad mirzaee · 2022-03 · Stack Overflow · on “Create direct file object in python”
I have images in 100 folders and the search results are slow, so I want to access those images, so maybe I wanna do it with python(if it is faster), in the way that when we select all the files, and drag and drop them in windows. then I realized that drag and drop in windows uses Component Object Model this source [LINK] . So I want to know is there any way in python to have COMs of the image files in those 100 folders in the same place (a specific folder)? or in other words can we create COMs of other files, (equivalent of shortcuts), cause I know shortcuts for my purpose won't work. The question in general is about how to access direct handles or COMs of files of different folders in one f
Cites Codinger123 · 2022-09 · Stack Overflow · on “TK drag&drop: Unable to load tkdnd library”
I am not able to run TkDnD I am using Python 3.10.6 with Win 10 in an virtual environment. I tried to follow the instructions in [LINK] i.e. copying TkinterDnD2 folder inside the Python/lib/site-packages (in my case C:\Users\my_user\my_python\my_env2\Lib\site-packages) tkdnd2.8 folder inside the Python/tcl folder (in my case C:\Users\my_user\my_python\my_env2\tcl) But there is no tcl folder in \my_env2. Creating the folder does not work. pip install tcl did not help. A tcl folder was created in lib/site-packages, but copying tkdnd2.8 there did not work. What can I do? Edit In a conda environment I found the path where to copy tkdnd2.8: C:\Users\my_user\miniconda3\envs\spyder-env2\Library\lib