title: Python - delete tables from docx file
body: <p>I have a docx file that I need to extract all of the text from. The docx also has tables which I want to disregard/delete.</p>
  
  <p>My current code is:</p>
  
  <pre><code>import docx2txt
  from docx.api import Document
  import docx
  
  #initialize the new columns
  ctext = list(textdb['txt'])
  ctable = list(textdb['tables'])
  
  #call in the file
  x = &lt;docx_filepath&gt;
  document = Document(x)
  tables = document.tables
  
  #see the actual text of tables
  for table in document.tables:
      for row in table.rows:
          for cell in row.cells:
              print (cell.text)
  
  #tells the count of how many tables are in the docx
  tablelength = str(len(tables))
  ctable.append(tablelength.replace("'",""))
  
  #process the actual text (this includes the table text right now)
  text2 = docx2txt.process(x)
  ctext.append(text2.replace("'",""))        
  
  #write values back to the list
  textdb['txt'] = ctext
  textdb['tables'] = ctable
  </code></pre>
  
  <p>I want all of the table text out of the file. Right now each table will show up as an individual element within python (EX:  docx.table.Table at 0x1d303c4f2b0)</p>
  
  <p>Any help would be great - thanks,</p>