location
is a widget rather than a string. The string representation of a tkinter widget is its internal name. Thus, when you do text=f"location: {location}"
you are creating a string that contains the name of the widget rather than the contents.
To display the contents you must fetch them from the widget. You’re already doing that when you define path
, so you just need to use {path}
rather than {location}
text=f"location: {path}"
CLICK HERE to find out more related problems solutions.