sharner commited on
Commit
e9b84ca
1 Parent(s): bf50f1c

Add program for getting song list

Browse files
Files changed (1) hide show
  1. list_songs.py +14 -0
list_songs.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ class ListSongs:
4
+ @staticmethod
5
+ def get_song_list():
6
+ list_output = ""
7
+
8
+ with open("./swedish_christmas_songs.json", "r", encoding='utf-8') as f:
9
+ songs = json.load(f)
10
+
11
+ for song in songs:
12
+ list_output += "- " + song['name'][:-4].replace("_", " ") + "\n"
13
+
14
+ return list_output.strip()