0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【メモ】Tweepyのログインの流れ

0
Last updated at Posted at 2021-04-16

Jsonファイルを読み込む(try文)

Jsonファイルが読み込めなかった場合、TwitterAPIのログイン認証をさせる(except文)

認証できたら、Jsonファイルにトークンを書き込む(except文内のtry文)

(except文を脱出し、)再びJsonファイルを読み込み、(try文)
ログインできたらPrintやらで表示させる

ログインできなかった場合、トークンが間違っていますと表示させる(except文)

構文

try:
Json読み込み処理
except:
try:
APIログイン処理
Json保存処理
try:
Json再読み込み処理
キーをセット
ログイン完了と表示
except:
ログイン出来ませんでしたと表示

すごく分かりにくいですがそこは許してやってください(笑)

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?