Home>

In the end, I would like to get tweets and account information using Tweepy in Python.
For that reason, I myself have no programming experience, so I would like to create a program that allows me to tweet only while viewing the site.
We would like to modify a part of it and do various things in the form of application.

The problem is how to enter the key etc. at the first Twitter application authentication and link with the account ...
For the time being, even if I enter a key and execute it, a black screen appears for a moment, which is a problem.
Applicable source code
import tweepy
CK = "Consumer Key"
CS = "Consumer Secret"
AT = "Access Token"
AS = "Access Token Secret"
auth = tweepy.OAuthHandler (CK, CS)
auth.set_access_token (AT, AS)
api = tweepy.API (auth)
api.update_status ("test")
What I tried

I can't do anything because I have no idea what the cause is ...
Of course, I have a Developer account and have confirmed that the key can be used with distribution tools.

Supplemental information (FW/tool version, etc.)

Python 3.8.1

  • Answer # 1

    I noticed the output because I was doing it without knowing that the character code was JIS and it was not UTF-8 and that the execution method from the command prompt was wrong and that it was posted to the account that acquired Developer No errors were seen.
    First of all, when I ran it from the command prompt with "Python file name", it says that it must be UTF-8, so I converted it and it was able to run safely.