drag-and-drop

TkinterDnd.Tk() event.data format

TkinterDnd.Tk() event.data format Question: When using TkinterDnd.Tk() to drop external files into the tk window, the event argument from the handler function has the paths of the files on a single string, separated by whitespaces. def handle_drop(event): paths = event.data.strip() drop_zone.dnd_bind(‘<<Drop>>’, handle_drop) So by adding .split() to paths, I get them individually. But my problems …

Total answers: 1

Drag and drop files to QListWidget created with QT-Designer

Drag and drop files to QListWidget created with QT-Designer Question: i am trying to implement a drag and drop feature to PyQt5 QListWidget it works if self.acceptDrops(True) is in the code but it works on whole application window and wherever i drag file in the window it will add a file to QListWidget… My goal …

Total answers: 1

Using drag and drop files or file picker with CustomTkinter

Using drag and drop files or file picker with CustomTkinter Question: I have recently decided to start learning Python and while doing several small projects as a hands-on approach, i discovered the customtkinter library (https://github.com/TomSchimansky/CustomTkinter) for more modern looking GUI development with Python. I wanted to do something which either requires a drag-and-drop component for …

Total answers: 1

How to get selected value in dropdown list, then pass it to views.py

How to get selected value in dropdown list, then pass it to views.py Question: I’m working on an upload file feature with dropdown and dropzone. But, whenever I submit the uploaded file with selected option, it always says that the selected option is None. I found it None after I printed the nama_bimbingan in views.py. …

Total answers: 2

Python Drag-and-drop broken

Python Drag-and-drop broken Question: I recently installed pywin (I had to change a registry entry to do it, but I changed it back). I also uninstalled Python 2.7, and since then, I can no longer drag and drop files onto my python scripts. I also lost my file associations. I have since uninstalled, reinstalled, run …

Total answers: 1

tkinter – How to drag and drop widgets?

tkinter – How to drag and drop widgets? Question: I am trying to make a Python program in which you can move around widgets. This is my code: import tkinter as tk main = tk.Tk() notesFrame = tk.Frame(main, bd = 4, bg = "a6a6a6") notesFrame.place(x=10,y=10) notes = tk.Text(notesFrame) notes.pack() notesFrame.bind("<B1-Motion>", lambda event: notesFrame.place(x = event.x, …

Total answers: 3

How to simulate HTML5 Drag and Drop in Selenium Webdriver?

How to simulate HTML5 Drag and Drop in Selenium Webdriver? Question: I am using Python 2.7 and Selenium 2.44. I want to automate drag and drop action in Selenium WD but according to other related posts Actions in HTML5 are not supported by Selenium yet. Is there any way to simulate drag and drop in …

Total answers: 2

PySide how to get a target on dropEvent

PySide how to get a target on dropEvent Question: I trying to make a user friendly drag and drop UI where I have to areas (QTreeWidgets) where you can drag and drop items. Some items can’t be dragged at all and some can be dragged but only onto certain items. I have managed to set …

Total answers: 3

Drag and drop onto Python script in Windows Explorer

Drag and drop onto Python script in Windows Explorer Question: I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn’t allow the script to …

Total answers: 8