python实现从word导出表格到excel小记

直接上代码

#-*-coding:utf-8 -*-
import docx
import openpyxl
import os
import sys
import re
import subprocess
#import xlwt
import time
from docx import Document #导入库


def read_word(wd):
    document = Document(wd) #读入文件
    tables = document.tables #获取文件中的表格集

    row_content = []
    for table in tables[:]: #i记录表序号
        tb_list = []
        for row in table.rows[:]:        #记录每个表的每一行存储于 row中
            list = []
            for cell in row.cells

你可能感兴趣的:(笔记)