title: TkinterDnD: how can I get the path of my dnd file from the function?
body: <p>I am creating a GUI that displays a list of paths of the dragged and dropped and after that, I need to get each file path and send it to another script for file transfer. I have tried using global variables, calling the fucntion, but when I call de function it requires an event variable but I haven't had any luck so far.</p>
  <pre><code>from tkinter import *
  from tkinterdnd2 import *
  
  def path_listbox(event):
      listbox.insert(&quot;end&quot;, event.data)
      testvariable.set(event.data)
      window.file_name = testvariable.get()
      file_path = str(window.file_name)
      
  
  window = TkinterDnD.Tk()
  window.title('GUI Test')
  window.geometry('500x275')
  window.config(background = '#eb5d52')
  frame = Frame(window)
  frame.pack()
  
  listbox = Listbox(frame,
      width = 50,
      height = 15,
      selectmode = SINGLE,
      )
  testvariable = StringVar()
  
  
  listbox.pack(fill = X, side = LEFT)
  listbox.drop_target_register(DND_FILES)
  
  listbox.dnd_bind('&lt;&lt;Drop&gt;&gt;', path_listbox)
  
  path_listbox()
  print(path_listbox)
  
  scrolbar = Scrollbar(frame,
      orient = VERTICAL)
  
  scrolbar.pack(side = RIGHT, fill = Y)
  
  listbox.configure(yscrollcommand = scrolbar.set)
  scrolbar.config(command = listbox.yview)
  
  window.mainloop()
  </code></pre>
  <p>The variable I'm trying to get is form the function path_list and the variable is file_path</p>