I am writing a tweepy based bot. I have the desired information being pulled and am trying to write that information to a text file for further parsing. However I am having a problem with f.write and am unsure how to approach the issue. Forgive me if this is covered elsewhere, while I searched I'm still pretty new to programming.
I left out authentication.
#!/usr/bin/python
searchQuery = 'foo'
fName = 'log.txt'
tweets = api.search(q=searchQuery,count=3,result_type="recent")
with open(fName, 'w') as f:
for tweet in tweets:
tweetText = tweet.text
f.write(tweetText)
print [tweetText]
error: UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 139: ordinal not in range(128)