node calls basic python function

This commit is contained in:
2022-04-26 13:37:00 -05:00
parent 8e65dcb06d
commit e7058e2d2d
4 changed files with 53 additions and 11 deletions

14
read_pdf.py Normal file
View File

@@ -0,0 +1,14 @@
import fitz
import sys
def read_PDF(path):
with fitz.open(path) as doc:
text = ""
for page in doc:
text += page.get_text()
with open(f'recipe_text/{text[:20]}.txt', 'w') as f:
f.write(text)
read_PDF('recipes/TheBestOfBaseballAwards.pdf')
sys.stdout.flush()