I am trying to open a text file in notepad++ using subprocess.Popen
I have tried many variations of the following code, but none of them work:
subprocess.Popen(['start notepad++.exe', 'C:\Python27\Django_Templates\QC\postits.html'])
subprocess.Popen(['C:\Program Files (x86)\Notepad++\notepad++.exe', 'C:\Python27\Django_Templates\QC\postits.html'])
There must be a way to do this.
NOTE:
I want to use subprocess.Popen and not os.system because I want to poll to determine whether the program is still open and do something after it closes.
So, this is part of the following code block:
process = subprocess.Popen(.....)
while process.poll() is None:
sleep(10)
DO SOMETHING AFTER FILE CLOSES
If Popen is not the best way to do this, I am open to any solution that allows me to poll my system (Windows) to determine whether notepad++ is still open, and allows me to do something after it closes.