master
example 2 years ago
parent 1e5bee5913
commit 01adcbde64
  1. 3
      .gitignore
  2. 10
      .idea/fb3test.iml
  3. 7
      main.py

3
.gitignore vendored

@ -129,3 +129,6 @@ dmypy.json
# Pyre type checker
.pyre/
#fb3
*.fb3
.idea

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.9 (fb3test)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,7 @@
from zipfile import ZipFile
from bs4 import BeautifulSoup
from lxml import etree
with ZipFile('1.fb3') as book:
for row in book.read('fb3/body.xml').decode('utf-8').splitlines():
print(row)
Loading…
Cancel
Save