It is a faucet. I'm not usually an engineer or anything. I don't really need it, but the windows on the street Usually when I drop a file, I feel like it's doing something about it.
Tkinter also looked like "I can do it". Well, if you drop the file normally, nothing happens.
This time, it wasn't listed on Qiita (maybe I just didn't find it) I decided to post it here so that I don't have to take the same steps in the future.
Windows10 64bit python3.7
TkinterDnD2 Apparently, by using TkinterDnD2 in addition to Tkinter It seems that you will be able to receive the dropped files.
Then, why not just "pip install" as usual? I thought.
ERROR: Could not find a version that satisfies the requirement tkinterdnd2 (from versions: none)
ERROR: No matching distribution found for tkinterdnd2```
it did not work out.
## Installation of TkinterDnD2
After surfing the internet, I finally arrived at this site.
I somehow downloaded the newer one from [here](https://sourceforge.net/projects/tkinterdnd/files/TkinterDnD2/).
When you unzip the downloaded file, you will find a lot of files.
This is a mess. What should I do?
If you surf the internet again
__ "Put the TkinterDnD2 folder in your site-packages folder" __.
There was certainly a folder called __ "TkinterDnD2" __ in the unzipped one.
I see, move this to site-packages ...
I stopped at that point.
__ Where are those site-packages? __
## I don't know the location of site-packages
I remember that site-packages is the place where people who get somehow pip install are placed.
And I've actually been there several times, but honestly I couldn't remember anything.
Again I surfed the internet.
I was able to get the path to site-packages by running the following command at the command prompt.
Thank you, internet.
[Thank you Tonks! ](Https://qiita.com/jaguti/items/be36b6a4f0260be2d044)
1. Start "Run" with Windows key + R
2. Type cmd and click "OK"
3.python -c "import site; print (site.getsitepackages())"
## After all, I can't!
I thought I was finally able to drag and drop after a hard time
I couldn't get an error normally.
Apparently, in addition to TkinterDnD2, you need __tkDnD2__.
tk seems to be an abbreviation, but apparently these two are completely different things.
Java and JavaScript are completely different things, and I want you to stop doing that.
## Installation of tkDnD2
From [here](https://sourceforge.net/projects/tkdnd/files/Windows%20Binaries/TkDND%202.8/), "tkdnd2.8-win32-x86_64.tar.gz" that should be compatible with 64bit I downloaded it.
It was an unseen type of compression called a gz file, but Lhaplus easily decompressed it.
When I unzipped it, I got a lot of files again.
This time, it seems that everything will be copied to the following folder.
__ (Omitted) \ Programs \ Python \ Python37 \ tcl \ tkdnd__
It already existed up to tcl.
I didn't have tkdnd, so I created it myself.
## I got the path of the dropped file!
![uma.gif](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/311431/2a6ec25c-9ea0-24b5-b604-15074789b45f.gif)
This time I got the path of the video and tried to draw it on the canvas.
It doesn't seem to be of any use as it is, but it seems to make sense to combine it with something.
Recommended Posts