Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from openpyxl import *
- from docx import Document
- # Visos excelio komandos
- wb = Workbook('C:\Users\Domas\Desktop\sarasas1.xls')
- ws = wb.active
- names = ws['A']
- surnames = ws['B']
- name = ws.rows
- currentName = []
- # Visos wordo komandos
- document = Document('C:\Users\Domas\Desktop\sertifikatas.docx') # Viduj () - tavo sablono path
- # Surasymas
- for each in name:
- currentName = name.names[each], name.surnames[each]
- for paragraph in document.paragraphs:
- if '*' in paragraph.text:
- paragraph.text = '%s' % currentName
- document.save('%d, %s '% paragraph.zfill(3), currentName)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement