Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TypeError: can't pickle module objects
- import multiprocessing as mp
- import tweepy
- class Auth:
- def __init__(self, *args, **kwargs):
- self.consumer_key = '**********'
- self.consumer_secret = '**********'
- self.access_token = '**********'
- self.access_token_secret = '**********'
- self.auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
- self.auth.set_access_token(self.access_token, self.access_token_secret)
- self.api = tweepy.API(self.auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
- def get_lists(self):
- self.following = self.api.friends_ids()
- return self.following
- def get_users(self, lst):
- for id in lst:
- user = self.api.get_user(id)
- print(user)
- break
- def run_mp(self, lst):
- p = mp.Process(target=self.get_users, args=(lst,))
- p.start()
- if __name__ == '__main__':
- a = Auth()
- user_list = a.get_lists()
- a.run_mp(user_list)
Add Comment
Please, Sign In to add comment