File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 22
22
'first item in ordered list' , style = 'List Number'
23
23
)
24
24
25
- document .add_picture ('C: \\ Users \\ soumi \\ Pictures \\ application .jpg' , width = Inches (1.25 ))
25
+ document .add_picture ('write-word-using-python .jpg' , width = Inches (1.25 ))
26
26
27
27
28
28
recordset = [
42
42
"desc" : "New item"
43
43
}
44
44
]
45
- print (recordset [0 ]['id' ])
45
+ # print(recordset[0]['id'])
46
46
table = document .add_table (rows = 1 , cols = 3 )
47
47
hdr_cells = table .rows [0 ].cells
48
48
hdr_cells [0 ].text = 'Id'
51
51
for item in recordset :
52
52
#print(item)
53
53
row_cells = table .add_row ().cells
54
- row_cells [0 ].text = item ['id' ]
55
- row_cells [1 ].text = item ['qty' ]
56
- row_cells [2 ].text = item ['desc' ]
54
+ row_cells [0 ].text = str ( item ['id' ])
55
+ row_cells [1 ].text = str ( item ['qty' ])
56
+ row_cells [2 ].text = str ( item ['desc' ])
57
57
58
58
document .add_page_break ()
59
59
60
- document .save ('simple.docx' )
60
+ document .save ('simple.docx' )
You can’t perform that action at this time.
0 commit comments