I have seen a few things on the site trying to help with this issue but I couldn't make head or tail as to what I'm doing wrong.
This bit of code is supposed to get a list of followers but no matter what I try I get a 429 error from the Twitter API:
def get_follow_list():
next_cursor = -1
while next_cursor != 0:
response = twitter.get_followers_list(screen_name=current_user, cursor=next_cursor)
following = response['users']
follow_list = [following]
time.sleep(1)
cursor = response['next_cursor']
return (follow_list)
How would I go about resolving this problem?
Edit: The code from the answer given is great but I get this error while trying to print the value from it: "UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 205571-205571: Non-BMP character not supported in Tk". This in turn causes the problem calling the GUI class as stated earlier. I'm not sure how to change the encoding of a list to something the listbox in my app can handle.