ankushshah89 / python-docx2txt

A pure python based utility to extract text and images from docx files.
MIT License
516 stars 97 forks source link

text = docx2txt.process("file.docx", "/tmp/img_dir") File not found #40

Open Charlie77-E opened 2 years ago

Charlie77-E commented 2 years ago

I have the following script:

import docx2txt

input_loc = input("Your docx location: ") output_loc = input("Output location: ")

text = docx2txt.process(input_loc.split('"')[1], output_loc.split('"')[1])

Where the input is: Your docx location: "C:\Users\Public\Documents\DV_TestReport-_Test_Plan.docx" Output location: "C:\Users\Public\Pictures\Temp_Images"

is showing the following error:

Traceback (most recent call last): File "C:/Users/cca/Downloads/TestImages.py", line 6, in text = docx2txt.process(input_loc.split('"')[1], output_loc.split('"')[1]) File "C:\Python\lib\site-packages\docx2txt\docx2txt.py", line 103, in process with open(dst_fname, "wb") as dst_f: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Public\Pictures\Temp_Images\image1.png'

beginner-cryptonyx commented 2 years ago

same issue