add picture inside word table python

Solutions on MaxInterview for add picture inside word table python by the best coders in the world

showing results for - "add picture inside word table python"
Nicole
30 May 2020
1import docx
2from docx import Document
3from docx.shared import Inches
4
5# dokument = docx.Document("JOB Ticket V1.1.docx")
6# dokument.save("wefewfew.docx")
7Job_Ticket_loc = r'Y:\35_Application Development\Testing_Q.A.docx'
8
9doc = Document(Job_Ticket_loc)
10tables = doc.tables
11p = tables[1].rows[3].cells[0].add_paragraph()
12r = p.add_run()
13
14tables[0].cell(2, 2).text = "text_test_Number"
15
16
17print((tables[1].cell(2, 2)))
18print((tables[0].cell(2, 2)))
19
20tables[0].cell(3, 2).text = "number of one_tow_three is the number of tow "
21r.add_picture('cool.jpg', width=Inches(4.0), height=Inches(1))
22doc.save('New_V_1.docx')