-1
I want the show to read. txt, record the 240char and post the tweet, and jump to the next 240char, as if you were reading and posting each line, but instead of serious line by amount of char. But I can’t identify how, someone could help me?
Code:
# reading
bookfile = open('book.txt', encoding = 'utf8')
booklines = bookfile.readlines()
bookfile.close()
# tweet
def tweet():
for line in booklines:
try:
print(line)
if line != '\n':
api.update_status(line, tweet_mode = 'extended')
sleep(300)
else:
pass
except tweepy.TweepError as e:
print(e.reason)
sleep(2)
tweet()
In case you were, right? Or how? ''bookfile = open('book.txt', encoding = 'utf8') booklines = wrap(bookfile.read(240)) bookfile.close() for message in booklines:'''
– Patok
@Patok I added the parameter I had forgotten...
– Woss