I have this script that allows dragging a file to a pyqt5 gui and receiving its path:
import sys from PyQt5.QtWidgets import QApplication, QMainWindow from id