Answers for "add picture inside word table python"

0

add picture inside word table python

import docx
from docx import Document
from docx.shared import Inches

# dokument = docx.Document("JOB Ticket V1.1.docx")
# dokument.save("wefewfew.docx")
Job_Ticket_loc = r'Y:\35_Application Development\Testing_Q.A.docx'

doc = Document(Job_Ticket_loc)
tables = doc.tables
p = tables[1].rows[3].cells[0].add_paragraph()
r = p.add_run()

tables[0].cell(2, 2).text = "text_test_Number"


print((tables[1].cell(2, 2)))
print((tables[0].cell(2, 2)))

tables[0].cell(3, 2).text = "number of one_tow_three is the number of tow "
r.add_picture('cool.jpg', width=Inches(4.0), height=Inches(1))
doc.save('New_V_1.docx')
Posted by: Guest on February-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language