spotipy/examples/tracks.py
2014-04-05 22:06:52 +03:00

13 lines
314 B
Python

# shows tracks for the given artist
from __future__ import print_function
import spotipy
import sys
sp = spotipy.Spotify()
if len(sys.argv) > 1:
artist_name = ' '.join(sys.argv[1:])
tracks = sp.search(q=artist_name, limit=20)
for i, t in enumerate(tracks['tracks']):
print(' ', i, t['name'])