Python-docx导入模块成功,但是在显示错误的代码中实现时

时间:2019-04-03 10:59:34

标签: python python-docx

我不知道为什么会出现此错误:

  1. 导入模块,您可以看到其导入成功

  2. 但是当在显示错误的代码中实现

如果该模块不存在,那么它将在终端上不可见

from docx import Document
from docx.shared import Inches
from docx.shared import Cm
from docx.enum.table import *
# from docx.enum.table import WD_ROW_HEIGHT_RULE


table = document.add_table(rows=1, cols=2)
table.style = 'Medium Shading 1 Accent 2'
table.rows[0].height_rule = WD_ROW_HEIGHT_RULE.EXACTLY

#rest of my rows & column code here

错误#1 enter image description here 错误2 enter image description here

0 个答案:

没有答案