16 lines
376 B
Python
16 lines
376 B
Python
|
from pypdf import PdfReader
|
||
|
import os
|
||
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||
|
|
||
|
reader = PdfReader(f"{dir_path}/sources/code-travail-2022.pdf")
|
||
|
|
||
|
full_text = ""
|
||
|
for page in reader.pages:
|
||
|
text = page.extract_text()
|
||
|
|
||
|
full_text += "\n"
|
||
|
full_text += text
|
||
|
|
||
|
with open(f"{dir_path}/sources/code-travail-2022.txt", "a") as myfile:
|
||
|
myfile.write(full_text)
|