десятков тысяч строкне являются большим обьемом
In [1]: with open('/tmp/1', 'w+', encoding='cp1251') as f: f.write('qwertyйцукен')
In [2]: cat /tmp/1
qwerty������
In [3]: with open('/tmp/1', 'r', encoding='cp1251') as f: print(f.read())
qwertyйцукен
In [4]: with open('/tmp/1', 'r', encoding='cp1251') as f:
...: with open('/tmp/2', 'w+', encoding='utf-8') as o: o.write(str(f.read()))
...:
In [5]: cat /tmp/2
qwertyйцукен
import csv
with open('some.csv', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
print(row)
list1 = ['1', '2', '3']
list2 = ['a', 'b', 'c']
list3 = ['x', 'y', 'z']
with open('eggs.csv', 'wb') as f:
wr = csv.writer(f)
wr.writerows([(list1[i], list2[i], list3[i]) for i in range(len(list1))])