【发布时间】:2015-04-08 04:03:56
【问题描述】:
我是 Python 的真正初学者,但一直在尝试弄乱 SoundCloud API。我遇到的唯一问题(到目前为止)是尝试使用以下方式返回我帐户中的关注用户列表:
打印client.get('/me/followings')
我得到这个作为回报:
<soundcloud.resource.Resource object at 0x02C51130>, <soundcloud.resource.Resource object at 0x02C51150>, <soundcloud.resource.Resource object at 0x02C51170>, <soundcloud.resource.Resource object at 0x02C51190>, <soundcloud.resource.Resource object at 0x02C511B0>, <soundcloud.resource.Resource object at 0x02C511D0>, <soundcloud.resource.Resource object at 0x02C511F0>, <soundcloud.resource.Resource object at 0x02C51210>, <soundcloud.resource.Resource object at 0x02C51230>, <soundcloud.resource.Resource object at 0x02C51250>
我假设这是因为我没有正确安装资源包装器?
这里是完整的代码:
import soundcloud
import simplejson as json
# create client object with app and user credentials
client = soundcloud.Client(client_id='xxx',
client_secret='xxx',
username='xxx',
password='xxx')
# print authenticated user's username
print client.get('/me').username
tracks = client.get('/me/followings')
print tracks
【问题讨论】:
标签: python soundcloud