Создал(а) 'src/fb3_reader/fb3.py'

This commit is contained in:
a2p1k02 2021-01-01 18:42:17 +00:00
parent eafb915717
commit 101dc8f11a
1 changed files with 12 additions and 0 deletions

12
src/fb3_reader/fb3.py Normal file
View File

@ -0,0 +1,12 @@
import sys
from zipfile import ZipFile
# from bs4 import BeautifulSoup
# from lxml import etree
def reader():
files = input("Enter the path to file: ")
with ZipFile(files) as book:
for row in book.read('2/fb3/body.xml').decode('utf-8').splitlines():
opened = open("test.txt", "a")
opened.write(row)