qmasingarbe / pymiere

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

Run subprocess check_output and calls without popups #7

Closed BigRoy closed 4 years ago

BigRoy commented 4 years ago

Issue

Run the check_output of subprocess with a hidden window to avoid the extra cmd popup.

We can pass the CREATE_NO_WINDOW bits for creation flags:

CREATE_NO_WINDOW = 0x08000000

check_output(call, creationflags=CREATE_NO_WINDOW)

See also here.

Is there any reason in this case not to do so?

I quickly added it to the subprocess calls in pymiere.exe_utils and it seemed to work. Tested in Python 2.7 (sorry, old Python I had laying around).

qmasingarbe commented 4 years ago

In my setup, even without the flag set I don't get any cmd popups when using the exe_utils functions with check_output... I don't know why, I tested it on Win10, python 2.7/3.6/3.7 I added the flag anyway as it had no impact on my tests. See commit https://github.com/qmasingarbe/pymiere/commit/8b4d15154f7dc00abee7a8d3b3ed00a37e3c4f3c