Easy Drag Files and Drop to Tkinter
Project description
Easy Drag Files and Drop to Tkinter
Only for windows
Installation
pip3 install tkdragfiles
pip3 install async_tkinter_loop #if u need asyncio
Easy to use
#for normal tk
import tkinter as tk
from tkdragfiles import start_dragfiles_event
root = tk.Tk()
root.geometry("600x200")
lb = tk.Listbox(root, height=500, width=500, selectmode=tk.SINGLE)
lb.pack()
def callback(file_paths):
for file_path in file_paths:
lb.insert("end", file_path)
start_dragfiles_event(root,callback)
root.mainloop()
#for asyncio tk
import tkinter as tk
from tkdragfiles import start_dragfiles_event
root = tk.Tk()
root.geometry("600x200")
lb = tk.Listbox(root, height=500, width=500, selectmode=tk.SINGLE)
lb.pack()
def callback(file_paths):
for file_path in file_paths:
lb.insert("end", file_path)
start_dragfiles_event(root,callback)
root.mainloop()
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tkdragfiles-0.0.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for tkdragfiles-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2702e5de1d6e57c03f34ac9d484f272d48879bd8798c6fefb349d69a521f6c9d |
|
MD5 | b55a7458d8aaf013c2af90af9277c7fd |
|
BLAKE2b-256 | 02915a5437e29d514a39123f1c255933c3fb95b728815e702bda487762df6c12 |