self.ui.le_name.textEdited.connect(self.test)
def test(self, k): #окраска лайнэдит в другой цвет при вводе текста
if k != '':
self.ui.le_name.setStyleSheet("QLineEdit"
"{"
"background : Gold;"
"}")
else:
self.ui.le_name.setStyleSheet("QLineEdit"
"{"
"background : White;"
"}")
from docxtpl import DocxTemplate,InlineImage
import glob
from docx.shared import Mm
#берем документ
doc = DocxTemplate('3.docx')
imageObjs = []
for fPath in glob.glob('1/*.jpg'):
print(fPath)
imgObj = InlineImage(doc, fPath, height =Mm (65))
imageObjs.append(imgObj)
context = {
"images": imageObjs
}
doc.render(context)
doc.save("context.docx")