wxPython: Dragging a file into window to get file path
问题 I want to drag a file into a window and get the file path. I've tried doing this: class CSVDropper(wx.FileDropTarget): def __init__(self, data): wx.FileDropTarget.__init__(self) self.data = data def OnDropFiles(self, x, y, filenames): self.data = filenames print self.data then in the main window: # Drag & Drop self.csv_path = None self.drop_table = CSVDropper(self.csv_path) self.SetDropTarget(self.drop_table) But this does nothing. I've tried running this tutorial code, but it doesn't do