from pathlib import Path
import subprocess
file_path = Path(r'C:\Users\86186\temp.tex')
subprocess.Popen([
"wt", "powershell", "vim", "--servername", "name", "--remote-silent",
file_path
])
print(file_path.read_text())
I hope to make the following program: When executed, a VIM terminal is opened on a temporary file. After making edits to the file and executing :wq
in vim, the terminal closes, and the python program reads the content of the file.
Currently, everything works fine except one: The python program is not waiting for the terminal to close. I tried subprocess.check_call()
but nothing improves. Is there a way I can tell the python program to halt and wait for the VIM terminal to close?