CodePudding user response:
Code to stick your import is what mean?
# word file open
Doc_file=docx. Document (doc_path)
CodePudding user response:
The import docxThe from docx import Document # import libraries
The import CSV
The import OS
The import tempfile as expected
The import win32api
The import win32print
Adress=input (' please enter to read file location:)
Paths=r '{}'. The format (adress)
For a1, b1, c1 in OS. Walk (paths) :
For w in b1:
Path1=r '{} \ {}'. The format (adress, w)
For a, b, c in OS. Walk (path1) :
For wenjianming in c:
If 'instruction in wenjianming:
Path=r '{} \ {}'. The format (path1, wenjianming)
Print (path)
# the try:
The document=document (path) # import failure in this step, but some files may be some can't, the same file format
Tables.=the document tables
Tamble_name=tables [1]
CodePudding user response:
or cut pictureCodePudding user response:
That may be a doc format problem, I come across some WPS process file, although the suffix is doc, but library is to identify the file format,Processing method is to save it again for docx file,