I am working on parsing a bunch of .docx files in python. I have saved all the .docx files in a folder named .docx_files. I want to make a list docx_list whose each element is one docx file saved in my .docx_files folder. To do this, I am using python-docx library. I created a list which contains paths of all the .docx files using os.walk() method. The list looks as given below
[‘C:/Users/HP/Desktop/.docx files\AbhijeetPawar[3_7] (1).docx’,
I passed this list to Document() method to get the required list. The code looks as below
for path in document_list:
resume_list = Document(path)
Now, when I printed the list by using the following code
for para in resume_list.paragraphs:
I can see only the document corresponding to the last path in my list. Can anyone help me find out what is going wrong? Also, suggest how to fix it.