M
M
Millerish2016-06-15 18:21:29
Python
Millerish, 2016-06-15 18:21:29

python api whats wrong?

Good evening!
I'm learning python, tell me what's wrong:
An article on which I'm trying.
Data:

#login +380985561286
#pass qweqweqwe
#id app 5509191
#key app wb18w64ly7S9wX47Nieq

The code:
import vk
vkapi = vk.API('5509191', '+380985561286', 'qweqweqwe')
vkapi.access_token=s
vkapi.wall.post(message="Hello, world"

Mistake:
/usr/bin/python3.5 /home/mk/Documents/vk/py.py
Traceback (most recent call last):
File "/home/mk/Documents/vk/py.py", line 7, in
vkapi = vk.API('5509191', '+380985561286', 'qweqweqwe')
TypeError: __init__() takes from 2 to 3 positional arguments but 4 were given
Process finished with exit code 1

Tell me why and how to fix it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Biryukov-Romanov, 2016-06-15
@Millerish

The article is old, the vk module has already been updated and now you need to work with it differently.
Here is a link to the github module: https://github.com/dimka665/vk
Here is an authorization example (at the very end): https://github.com/dimka665/vk/blob/master/docs/us...

P
Pavel Shvedov, 2016-06-15
@mmmaaak

Doesn't it bother you that the article is from 2014? You should at least look at the current documentation for the module you are using

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question