Fix twitter.py to read new directories

This commit is contained in:
newt! 2021-08-23 14:24:31 +01:00
parent 6c48925bc5
commit a354d88ee5

View file

@ -1,11 +1,13 @@
import csv import csv
import os
class Account: class Account:
def __init__(self, csvfile): def __init__(self, csvfile):
self.handle = csvfile[:-4] self.handle = csvfile[:-4]
self.bio = '' self.bio = ''
self._tweets = [] self._tweets = []
with open(csvfile, 'r',encoding='utf-8') as file: filePath = '{0}/{1}'.format(os.path.dirname(os.path.realpath(__file__)), csvfile)
with open(filePath, 'r',encoding='utf-8') as file:
reader = csv.reader(file) reader = csv.reader(file)
first_row = 1 first_row = 1
for row in reader: for row in reader: