title: multiple .doc to .docx file conversion using python
body: <p>I want to convert all the .doc files from a particular folder to .docx file.</p>
  
  <p>I tried using the following code,</p>
  
  <pre><code>import subprocess
  import os
  for filename in os.listdir(os.getcwd()):
      if filename.endswith('.doc'):
          print filename
          subprocess.call(['soffice', '--headless', '--convert-to', 'docx', filename])
  </code></pre>
  
  <p>But it gives me an error:
      OSError: [Errno 2] No such file or directory</p>