import copy
dokum = 'one, two'
dokum = dokum.split(',')
for i in range(len(dokum)):
dokum[i] = '- ' + dokum[i].lstrip() + ';'
print("Список с ; в конце ", dokum)
docum_s_dot = copy.copy(dokum)
docum_s_dot[-1] = docum_s_dot[-1][:-1] + '.'
print("Список с . в конце ", docum_s_dot)
print("Список с ; в конце ", dokum)
Список с ; в конце ['- one;', '- two;']
Список с . в конце ['- one;', ' - two.']
Список с ; в конце ['- one;', ' - two;']
text = []
for paragraph in document.paragraphs:
text.append(paragraph.text)
print('\n'.join(text))
print(re.search(r'\d\d\D\d\d\d\D\d', text))
import time
from sys import argv
for i in argv[1:]:
print(i)
time.sleep(100)
--------------------------------------------------
Конвертирование файла C:\Users\Игорь\Pictures\Сканы\Новая папка (3)\2022-01-19-
0002.pdf
--------------------------------------------------
Traceback (most recent call last):
File "C:\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 466,
in pdfinfo_from_path
raise ValueError
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Scripts\pdf2jpg.py", line 62, in <module>
s.convert_file()
File "c:\Scripts\pdf2jpg.py", line 39, in convert_file
pages = convert_from_path(path, self.CONST, poppler_path=self.POPPLER_PATH)
File "C:\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 97, i
n convert_from_path
page_count = pdfinfo_from_path(pdf_path, userpw, poppler_path=poppler_path)[
"Pages"]
File "C:\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 475,
in pdfinfo_from_path
raise PDFPageCountError(
pdf2image.exceptions.PDFPageCountError: Unable to get page count.
I/O Error: Couldn't open file 'C:\Users\<d0><98><d0><b3><d0><be><d1><80><d1><8c>
\Pictures\<d0><a1><d0><ba><d0><b0><d0><bd><d1><8b>\<d0><9d><d0><be><d0><b2><d0><
b0><d1><8f> <d0><bf><d0><b0><d0><bf><d0><ba><d0><b0> (3)': Illegal byte sequence
.
C:\Users\Игорь\Pictures\Сканы\Новая папка (3)>