МW
import docx
import os
Label(text="Медичні терміни:").grid(row=1, column=0, columnspan=2, sticky=N + W, pady=10, padx=10)
text1 = Text(width=30, height=4, wrap=WORD)
text1.grid(row=1, column=2, columnspan=2, rowspan=2, sticky=N + W, pady=10, padx=10)
yScroll = Scrollbar(orient=VERTICAL)
yScroll.grid(row=2, column=0, columnspan=2, rowspan=4, sticky=NE + S, pady=10)
box = Listbox(width=30, height=10, yscrollcommand=yScroll.set)
box.grid(row=2, column=0, columnspan=2, rowspan=4, sticky=N + W, pady=10, padx=10)
paths = []
folder = os.getcwd()
for root, dirs, files in os.walk(folder):
for file in files:
if file.endswith('docx') and not file.startswith('~'):
paths.append(os.path.join(root, file))
def col1():
for path in paths:
doc = docx.Document(path)
for table in doc.tables:
for totcol in table.columns:
box.insert(END)
mWin.mainloop()
col1()
