mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Fix comments and parentheses in my_top_tracks.py
This commit is contained in:
parent
ba6e9a0b79
commit
cc158c34f1
@ -1,4 +1,4 @@
|
|||||||
# Adds tracks to a playlist
|
# Shows the top tracks for a user
|
||||||
|
|
||||||
import pprint
|
import pprint
|
||||||
import sys
|
import sys
|
||||||
@ -21,11 +21,11 @@ if token:
|
|||||||
sp.trace = False
|
sp.trace = False
|
||||||
ranges = ['short_term', 'medium_term', 'long_term']
|
ranges = ['short_term', 'medium_term', 'long_term']
|
||||||
for range in ranges:
|
for range in ranges:
|
||||||
print "range:", range
|
print ("range:", range)
|
||||||
results = sp.current_user_top_tracks(time_range=range, limit=50)
|
results = sp.current_user_top_tracks(time_range=range, limit=50)
|
||||||
for i, item in enumerate(results['items']):
|
for i, item in enumerate(results['items']):
|
||||||
print i, item['name'], '//', item['artists'][0]['name']
|
print (i, item['name'], '//', item['artists'][0]['name'])
|
||||||
print
|
print ()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Can't get token for", username)
|
print("Can't get token for", username)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user