The method os.path.abspath()
returns an absolute version of the provided path, but it can’t know what folder that path is in. It actually assumes that the provided path is in the current working directory. To get the correct path, change:
the_location = os.path.abspath(required_file)
self.root.ids.scroll.add_widget(OneLineListItem(text=required_file, on_release=self.play_song))
to:
the_location = os.path.abspath(os.path.join(root, required_file))
self.root.ids.scroll.add_widget(OneLineListItem(text=the_location, on_release=self.play_song))
With that change, your code should work.
CLICK HERE to find out more related problems solutions.