Song Management Example
This example shows a full run of the program, including all the options and features. User input shown in bold.
$ python3 songs.py
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 3
List of all songs:
1 | Led Zeppelin | Stairway to Heaven | 8:02
2 | Metallica | Master of Puppets | 8:35
3 | Adele | Rolling in the Deep | 3:48
4 | Madonna | Material Girl | 4:00
5 | Yeah Yeah Yeahs | Burning | 4:05
6 | The Clash | Should I Stay or Should I Go | 3:08
7 | Jim Croce | You Don't Mess Around with Jim | 3:02
8 | Aretha Franklin | Respect | 2:27
9 | Kate Bush | Running up that Hill | 5:00
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 2
Which song ID? 10
No matching song found.
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 2
Which song ID? 5
5 | Yeah Yeah Yeahs | Burning | 4:05
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 4
Song ID: 0
Please enter an integer larger than 0.
Song ID: 9
Sorry, song ID 9 is already in use.
Song ID: 15
Artist: Kevin
Title: Nothing anyone wants to hear
Duration (in seconds): -5
Please enter an integer larger than 0.
Duration (in seconds): 10
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 3
List of all songs:
1 | Led Zeppelin | Stairway to Heaven | 8:02
2 | Metallica | Master of Puppets | 8:35
3 | Adele | Rolling in the Deep | 3:48
4 | Madonna | Material Girl | 4:00
5 | Yeah Yeah Yeahs | Burning | 4:05
6 | The Clash | Should I Stay or Should I Go | 3:08
7 | Jim Croce | You Don't Mess Around with Jim | 3:02
8 | Aretha Franklin | Respect | 2:27
9 | Kate Bush | Running up that Hill | 5:00
15 | Kevin | Nothing anyone wants to hear | 0:10
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 2
Which song ID? 15
15 | Kevin | Nothing anyone wants to hear | 0:10
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 1
Which file would you like to read? /usr/local/doc/songs/small.txt
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 3
List of all songs:
1 | Led Zeppelin | Stairway to Heaven | 8:02
2 | Metallica | Master of Puppets | 8:35
3 | Adele | Rolling in the Deep | 3:48
4 | Madonna | Material Girl | 4:00
5 | Yeah Yeah Yeahs | Burning | 4:05
6 | The Clash | Should I Stay or Should I Go | 3:08
7 | Jim Croce | You Don't Mess Around with Jim | 3:02
8 | Aretha Franklin | Respect | 2:27
9 | Kate Bush | Running up that Hill | 5:00
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 5
Song #1 ID? 6
Song #2 ID? 7
Song #3 ID? 4
Song #4 ID? 9
Song #5 ID? 2
Final playlist:
6 | The Clash | Should I Stay or Should I Go | 3:08
7 | Jim Croce | You Don't Mess Around with Jim | 3:02
4 | Madonna | Material Girl | 4:00
9 | Kate Bush | Running up that Hill | 5:00
2 | Metallica | Master of Puppets | 8:35
Total duration: 23:45
--CS 21 Song Management System--
1) Load songs from file
2) Display individual song details
3) Display all song details
4) Add song
5) Build playlist
0) Quit
What would you like to do? 0
Bye!