V
V
Vladislav2019-03-23 14:08:10
Python
Vladislav, 2019-03-23 14:08:10

VK API error in Python TypeError: __call__() takes exactly 1 argument (2 given) what to fix?

Good afternoon, you need to display a list of user groups

import vk
access_token = "123456789"
v = 5.92
session = vk.Session(access_token=access_token)
vkapi = vk.API(session)
userid=123456789
subscriptions_list = vkapi.users.getSubscriptions( v, user_id=userid, extended=0)['groups']['items']
print(subscriptions_list)


The error is
------------------------------------
TypeError Traceback (most recent call last)
in
---- > 7 subscriptions_list = vkapi.users.getSubscriptions( v, user_id=152403417, extended=0)['groups']['items']
TypeError: __call__() takes 1 positional argument but 2 were given

What's wrong with the construct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Ogai, 2019-03-23
@ogai22

subscriptions_list = vkapi.users.getSubscriptions( v = v, user_id=userid, extended=0)['groups']['items']

Named arguments must be specified.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question