spotipy/examples/my_playlists.py
Niko 2bc8d35fc6
Formatted strings (#1178)
* use newer string formatters (https://pyformat.info)

* fix typo

* went through the files again, additions from #1165 are also included

* replace .format() with f strings
2025-01-14 07:56:47 +01:00

12 lines
301 B
Python

# Shows a user's playlists
import spotipy
from spotipy.oauth2 import SpotifyOAuth
scope = 'playlist-read-private'
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
results = sp.current_user_playlists(limit=50)
for i, item in enumerate(results['items']):
print(f"{i} {item['name']}")