Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1.     def __init__(self, login, password, app_id=-1):
  2.         try:
  3.             if app_id == -1:
  4.                 self.api = vk_api.VkApi(login=login, password=password)
  5.             else:
  6.                 self.api = vk_api.VkApi(login=login, password=password, app_id=app_id)
  7.  
  8.             self.api.authorization()  # Авторизируемся
  9.         except vk_api.AuthorizationError as error_msg:
  10.             print(error_msg)
  11.             exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement