Insarov
Insarov

Reputation: 1041

Drag and Drop Files into Folders via Python GUI?

Problem
I'm trying to make a gui in python that displays two directories in two side-by-side panels and their contents (via tree, thumbnails, list, etc), which then allows the user to either:

  1. drag files between both panels
  2. select files to transfer (manually and via script), and transfer after user input

The point is to automate as much of the process as possible, but allow the user to verify each file's final transfer.

Is this possible? Which python gui library would be ideal for this? I'm just looking for a general direction, since I really don't know where to begin looking.

Current workaround
I have a python script that will sort mail into subfolders based on client, and then iterates through each client, simultaneously opening mail\<client> and the client's main file directory in explorer. I drag each file to its appropriate <main>\<client\<subfolder>, close the two windows, press 'enter' in IDLE, and it moves on to the next client. Tedious, but it's a rough implementation.

System info
Windows XP, Python 2.7

Upvotes: 0

Views: 2088

Answers (2)

Aya
Aya

Reputation: 41950

Well, you could implement a custom drag-and-drop with any GUI framework, so you might consider using Tkinter, since it's built-in to the standard Python library.

If you need to be able to drag-and-drop between applications, it's a bit more complicated, but supposedly can be achieved with Tkinter, although you might prefer to use wxPython, for which there's an example on the wiki.

Upvotes: 1

TheoretiCAL
TheoretiCAL

Reputation: 20571

For anything file related I would use the Python os module, http://docs.python.org/2/library/os.html

Upvotes: 0

Related Questions