Spaces:
Build error
Build error
File size: 560 Bytes
324e9cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from docx import Document
def read_text_from_word(file_path):
"""Extracts and returns all text from a Word document."""
# Load the document
doc = Document(file_path)
# Extract text from each paragraph
text = []
for paragraph in doc.paragraphs:
if paragraph.text.strip(): # Skip empty lines
text.append(paragraph.text.strip())
return "\n".join(text)
file_path = "Sample_Resume.docx" # Replace with your file path
resume_skills = read_text_from_word(file_path)
print(resume_skills) |