Error while converting pdf to htmls using subprocess

Hi,

I am trying to converting pdf to html using the following code

filename = ‘1_1.pdf’
outputFilename = filename.replace(“.pdf”,“.html”)
subprocess.run([“pdf2htmlEX”,filename,outputFilename])

but I am encountering
FileNotFoundError: [WinError 2] The system cannot find the file specified

Can someone help me

Your Python code shows messed up. Did you notice? You have to enclose it between triple backticks to prevent Markdown from mangling it:

```
Your code will be here.
```

Also please, next time include the complete traceback, not just part of it.


Your problem is most probably described in this post (for executable open instead of yours pdf2htmlEX):

Also see the warning for args arguments of subprocess.run: