Fixing utf-8 encoding when writing files.
parent
74bc7398bb
commit
0c596d5f91
|
@ -2,7 +2,6 @@ import helpers
|
||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import codecs
|
|
||||||
|
|
||||||
|
|
||||||
def getTweets():
|
def getTweets():
|
||||||
|
@ -107,7 +106,9 @@ def tootTheTweet(tweet):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
tweet_check = codecs.open(tweet_check_file_path, mode='w', encoding='utf-8')
|
tweet['text'].encoding('utf-8')
|
||||||
|
|
||||||
|
tweet_check = open(tweet_check_file_path, mode='w')
|
||||||
tweet_check.write(tweet['text'])
|
tweet_check.write(tweet['text'])
|
||||||
tweet_check.close()
|
tweet_check.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue