File size: 395 Bytes
f8dd39f
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os

class ListSongs:
    @staticmethod
    def get_song_list():
        folder_path = './swedish_christmas_songs'

        list_output = ""

        for filename in sorted(os.listdir(folder_path)):
            if filename.endswith('.txt'):  # Check if the file is a text file
                list_output += "- " + filename[:-4].replace("_", " ") + "\n"

        return list_output.strip()