Y
Y
yhikaru2019-11-07 01:51:14
Python
yhikaru, 2019-11-07 01:51:14

Why does vk.groups.get in vk_api give an error in Python?

id1 = 9938656
print(vk.groups.get(user_id=id1, extended=1, fields=can_message, members_count))
Before that, only authorization.
Error:
vk.groups.get(user_id=id1, extended=1, fields=can_message, members_count)
Syntax Error: positional argument follows keyword argument: , line 9, pos 59
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2019-11-07
@yhikaru

Syntax Error: positional argument follows keyword argument: , line 9, pos 59

Clearly says that you can not put positional arguments after key ones. First, all positional, then by keys (through the equal sign).
vk.groups.get(user_id=id1, extended=1, fields=can_message, members_count )
In this case, members_count cannot be put at the end without specifying the argument name, it should be:
vk.groups.get(user_id=id1, extended=1, fields=can_message, count=members_count)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question