2021-01-01 18:42:17 +00:00
|
|
|
from zipfile import ZipFile
|
|
|
|
|
|
|
|
|
2021-01-03 13:32:31 +00:00
|
|
|
def reader(path_to_file):
|
|
|
|
with ZipFile(path_to_file) as book:
|
|
|
|
for book_content in book.read('2/fb3/body.xml').decode('utf-8').splitlines():
|
|
|
|
output_content = open("test.txt", "a")
|
|
|
|
output_content.write(book_content)
|