Home>
I wrote a code to get the Twitter timeline using python,
I got an error.
IndentationError: expected an indented block
So I tried putting a blank first,
IndentationError: unexpected indent
This time I came out with no need for indentation.
What kind of problem is it, and is the timeline acquisition code correct? I would appreciate if you could let me know not only about the error, but any other problems.
The code is as follows.
>>>auth.set_access_token(access_token, access_token_secret)
>>>api = tweepy.API(auth)
>>>status_list = api.home_timeline()
>>>from datetime import timedelate():
File "<stdin>", line 1
from datetime import timedelate():
^
SyntaxError: invalid syntax
>>>for status in api.home_timeline():
...
File "<stdin>", line 2
^
IndentationError: expected an indented block
>>>for status in api.home_timeline():
File "<stdin>", line 1
for status in api.home_timeline():
^
IndentationError: unexpected indent
code
The sites I referred to are as follows.
[Link content] (www.pytry3g.com/entry/python-twitter-timeline#See the contents of the acquired timeline)
-
Answer # 1
Related articles
- python - error in image binarization using cv2adaptivethreshold function
- python - i get an error when using an application created with django's startapp
- python 3x - when using tensorflow-gpu, i get an error if the descriptor cannot be loaded
- error when using t-sne python
- emoji counting using twitter api in python
- i want to resolve a syntax error in a python while statement
- syntaxerror: invalid syntax error python
- python 3x - an error occurs after registering a dictionary with a read-aloud bot on discordpy
- python - aggregation processing using pandas
- python - attributeerror:'series' object has no attribute'flags' error
- python - watchdog is installed, but i get the error modulenotfounderror: no module named'watchdog'
- about the cause of the error in python pdto_datetime
- python - i got an import error even though i did pip install
- python - i want to create and save a graph, but i get an error
- error when reading excel in python
- python - how to resolve attribute error
- python - i get a key error
- python - an error occurs in the if statement program that compares the size of numbers
- python - i want to put the image file path in a variable and open it using that variable
- python error compare with future stock price
Related questions
- python : List of dictionaries?
- javascript : How can I get the hidden site API
- How to write script via API in Python?
- How to translate into a normal format -a date from numbers. Python
- Hello, how can I bypass recaptcha v2 on a website via python, then login to the website and create cookies?
- You need to add a hyperlink and data from api for telegram bot in python
from datetime import timedelate():
Compare it with the code on the reference page. The final parenthesis and colon are not required.
I also misspelled time.