There is a problem when starting the function, could you help me?
from Tkinter import *
from tkFileDialog import *
import getpass
import os
usuario = getpass.getuser()
ventana = Frame(height=400,width=400,background="black")
ventana.pack()
def elegir():
archivo=askopenfile(mode="r",initialdir="C:/Users/%s/Desktop" % usuario,
filetypes=(("Documento word","*.doc",),("ALL FILES","*.*.*")))
directorio = os.path.split(archivo)[0]
print(directorio)
boton_eleg = Button(ventana,text="SELECCIONE EL ARCHIVO",command=elegir).place(x=10,y=220)
ventana.mainloop()
I want to print the route only, but I run into the problem in the console.
I would appreciate a help.