vars refactor and, stub file to type annotation and add way to take version #3

Scalone
SiberiaBreadFactory merged 3 commits from a2p1k02/fb3test:master into master 2021-05-24 12:30:46 +00:00
3 zmienionych plików z 7 dodań i 8 usunięć
Pokazywane tylko zmiany commita 58a7e70860 - Pokaż wszystkie commity

Wyświetl plik

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

1
src/fb3_reader/fb3.pyi Zwykły plik
Wyświetl plik

@ -0,0 +1 @@
def reader(path_to_file: str): ...

Wyświetl plik

@ -1,4 +1,4 @@
from fb3_reader import fb3 from fb3_reader import fb3
if __name__ == '__main__': if __name__ == '__main__':
fb3.reader() fb3.reader(input("Enter path to file: "))