0

I want to be able to pause my code, open the word document and edit it, and after saving the edits and exiting the document I want to keep running the rest of the code. If I run it manually cell by cell it works, but when I run all cells at once the following cells are being run as soon as the word is open. I am not sure how to make sure the rest of the code doesn't start until I save and close the file.

import subprocess
subprocess.call(["start", my_file],shell=True)
tripleee
  • 175,061
  • 34
  • 275
  • 318
Cristian
  • 93
  • 1
  • 7
  • 2
    That's the purpose of the `start` command on Windows, isn't it? If you want to run Word, just run Word as a subprocess directly instead. `subprocess.call()` definitely waits for the subprocess to complete. (Once you get rid of the `start`, you can get rid of the `shell=True` too.) – tripleee Aug 04 '21 at 07:51
  • Does this answer your question? [wait process until all subprocess finish?](https://stackoverflow.com/questions/15107714/wait-process-until-all-subprocess-finish) – Almog-at-Nailo Aug 04 '21 at 07:54

0 Answers0