fb3test/src/fb3_reader/fb3.py

11 lines
337 B
Python

from zipfile import ZipFile
# from bs4 import BeautifulSoup
# from lxml import etree
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)