I am using a python discogs api package to retrieve a music playlist from online.
I need to iterate through this list to view all results, but no matter what I try I get a typeerror saying 'list object is not iterable / subscriptable'
d = discogs_client.Client('ExampleApplication/0.1', user_token=DISCOGS_TOKEN)
results = d.list('117796')
print('results=')
print(results)
print(results[0])
you can see I am returning a list just fine, but if I try to view the contents of said list, I get an error
results=
<List '117796' 'Ron Hardy @ Music Box'>
Traceback (most recent call last):
File "twitter_bot.py", line 52, in <module>
artist = results[0].artists[0]
TypeError: 'List' object is not subscriptable
I am using a python discogs api package to retrieve a music playlist from online. I need to iterate through this list to view all results, but no matter what I try I get a typeerror saying 'list object is not iterable / subscriptable'
you can see I am returning a list just fine, but if I try to view the contents of said list, I get an error