mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-01-06 14:52:50 +00:00
Py3 print (and pep8)
This commit is contained in:
parent
28443a0739
commit
411f648064
@ -9,8 +9,6 @@ if len(sys.argv) > 1:
|
|||||||
else:
|
else:
|
||||||
urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
|
urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
|
||||||
|
|
||||||
|
|
||||||
sp = spotipy.Spotify()
|
sp = spotipy.Spotify()
|
||||||
artist = sp.artist(urn)
|
artist = sp.artist(urn)
|
||||||
pprint.pprint(artist)
|
pprint.pprint(artist)
|
||||||
|
|
||||||
|
@ -12,4 +12,3 @@ else:
|
|||||||
sp = spotipy.Spotify()
|
sp = spotipy.Spotify()
|
||||||
track = sp.track(urn)
|
track = sp.track(urn)
|
||||||
pprint.pprint(track)
|
pprint.pprint(track)
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# shows tracks for the given artist
|
# shows tracks for the given artist
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import spotipy
|
import spotipy
|
||||||
import sys
|
import sys
|
||||||
sp = spotipy.Spotify()
|
sp = spotipy.Spotify()
|
||||||
@ -8,5 +9,4 @@ if len(sys.argv) > 1:
|
|||||||
artist_name = ' '.join(sys.argv[1:])
|
artist_name = ' '.join(sys.argv[1:])
|
||||||
tracks = sp.search(q=artist_name, limit=20)
|
tracks = sp.search(q=artist_name, limit=20)
|
||||||
for i, t in enumerate(tracks['tracks']):
|
for i, t in enumerate(tracks['tracks']):
|
||||||
print ' ', i, t['name']
|
print(' ', i, t['name'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user