I've looked in other questions, and apparently none have the answer, sorry if something is wrong or if you need more information, I'm new.
def seleciona(self):
self.posicao = self.mostrar.curselection()
if self.posicao[0] == '':
messagebox.showinfo('Alerta','Precisa selecionar musica para tocar')
else:
nome = todos[int(self.posicao[0])]