Subprocess.create_new_console
I have this Python code. import subprocess subprocess.Popen('airmon-ng check kill', creationflags = subprocess.CREATE_NEW_CONSOLE) Python 2.7.6 on Linux Mint gives me the followi
Solution 1:
subprocess.Popen("airmon-ng check kill", shell=True)
Will do what you want, which I presume is to open a shell and execute airmon-ng check kill
through Python.
I've looked through the subprocess docs and the only thing pointing to CREATE_NEW_CONSOLE
states that creationflags
is only available in Windows which would explain why it doesn't work in Linux Mint.
The docs for CREATE_NEW_CONSOLE also states that
The new process has a new console, instead of inheriting its parent’s console (the default). This flag is always set when Popen is created with
shell=True
.
So just using shell=True
is the best way to do what you want.
Post a Comment for "Subprocess.create_new_console"