def opendocx(file):
 mydoc = zipfile.ZipFile(file)
 xmlcontent = mydoc.read('word/document.xml')
 document = etree.fromstring(xmlcontent)
 return document

def opendocx ( file ) : mydoc = zipfile . ZipFile ( file ) xmlcontent = mydoc . read ( 'word/document.xml' ) document = etree . fromstring ( xmlcontent ) return document
open a docx file .