Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tkdragfiles

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tkdragfiles

Easy Drag Files and Drop to Tkinter

  • 0.0.2
  • PyPI
  • Socket score

Maintainers
1

PyPI

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.title("Drags file to me")
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)

from async_tkinter_loop import async_handler, async_mainloop,get_event_loop,main_loop

loop = get_event_loop()
loop.run_until_complete(main_loop(root))

References

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc