def retrieveBands(self): sql = "SELECT * from band" cur.execute(sql) self.myBands = [] for row in cur: b = Band() b.band_id = row[0] b.name = row[1] self.myBands.append(b)
MP.retrieveSongs() genre = input("enter genre") for song in MP.myLibrary: if song.genres == genre: song.playSong() else: break if choice == "5": while True: choice5 = input("1. add new Band 2. Play Songs to a certain Band" + " 3. View all Bands 4. back:\n") if choice5 == "1": band = Band() band.name = input("Enter Band name:") bandNum = int(input("Enter # of band Members:")) MP.retrieveArtists() MP.viewArtists() artistsIDsList = [] for i in range(0, bandNum): artistsIDsList.append(MP.myArtists[int(input("Enter # of the artist:"))-1].artist_id) band.addBand(artistsIDsList) if choice5 == "2": MP.retrieveBands() MP.viewBands() bandNum = int(input("Enter # of band"))-1 bandSongs = MP.myBands[bandNum].retrieveBandSongs() for i in range(0, len(bandSongs)):