Merge pull request 'Refactoring' (#1) from a2p1k02/fb3test:master into master
Reviewed-on: http://git.macaw.me:3000/SiberiaBreadFactory/fb3test/pulls/1
This commit is contained in:
commit
e5b215f635
@ -1,10 +0,0 @@
|
|||||||
<?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>
|
|
7
main.py
7
main.py
@ -1,7 +0,0 @@
|
|||||||
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)
|
|
BIN
src/fb3_reader/1.fb3
Normal file
BIN
src/fb3_reader/1.fb3
Normal file
Binary file not shown.
BIN
src/fb3_reader/__init__.py
Normal file
BIN
src/fb3_reader/__init__.py
Normal file
Binary file not shown.
12
src/fb3_reader/fb3.py
Normal file
12
src/fb3_reader/fb3.py
Normal 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)
|
4
src/main.py
Normal file
4
src/main.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
from fb3_reader import fb3
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
fb3.reader()
|
Loading…
Reference in New Issue
Block a user