qmasingarbe / pymiere

Python for Premiere pro
GNU General Public License v3.0
363 stars 46 forks source link

Can we remove the need for .bat file to start Premiere? #8

Closed BigRoy closed 4 years ago

BigRoy commented 4 years ago

Issue

It seems the .bat file was introduced to not start Premiere Pro as the child process of the Python process. However, I believe that is also possible from subprocess directly.

# pseudocode
import subprocess

CREATE_NEW_CONSOLE = 0x00000010
subprocess.Popen(call, creationflags=CREATE_NEW_CONSOLE)

For example also used here. That code can start applications just fine without it keeping parent connections with the Python process.

Would this be applicable and usable for pymiere to start Premiere too?

qmasingarbe commented 4 years ago

I did some testing, if I execute the py in a simple console interpreter, Premiere seems to stay open when I kill the script or console. I only have the problem when running the script inside Pycharm, if I stop the script Premiere exits. Maybe Pycharm does some magic to kill processes on python stop? Anyway I added your solution as the default and left the old .bat trick available as a function argument @BigRoy thank you for telling me about those creationflags!