Всем привет У меня специфичная (для меня
from docxtpl import DocxTemplate doc = DocxTemplate("template.docx") for i in patients: # переменная для замены в шаблоне context = {'patient': i, 'date': date.get()} doc.render(context) doc.save(path+ '/'+ i +".doc") Он работает, но когда я пытаюсь открыть *.doc в Open Office я. получаю ошибку о повреждённом файле. MS Office открывает его без проблем.
Hello everybody I have a specific (for me
from docxtpl import DocxTemplate doc = DocxTemplate("template.docx") for i in patients: # data for replace context = {'patient': i, 'date': date.get()} doc.render(context) doc.save(path+ '/'+ i +".doc") It worked, but when I tried open with Open Office *.doc I take an error about damaged file. MS Word opened it without any problem.
Если я создаю *.docx, то потом не могу с ним работать, точнее я не могу его сохранить, Open Office может только читать docx. В общем я могу создать docx но не могу с ним работать или я могу создать doc но Open Office не может открыть его (я думаю, что мой код неверно сохраняет docx в doc т.к. если я сохраню doc через MS Office, то Open Office успешно его откроет).
If I created *.docx then I can't work with it more precisely I can't save it because Open Office can only reed docx. It turns out that I can create docx but can't work with it or I can make doc but Open Office can't open it (I think that my code wrong saving docx to doc, because if I save doc with MS Office Open Office successfully opened it).