请问python能否判断word中是否有表格(if语句),如果有则提取表中段落文字,没有则不做处理,感谢解答
import xlrd
from docx import Document
doxFile = "doc_File"
d = Document(doxFile)
t = d.tables
if len(t) != 0:
for i in range(len(t)):
each_table = t[i]
print(each_table.cell(3,3).text) # 这里自行打印内容,cell(a,b),a代表列,b代表行
else:
pass