python - Subprocess.CREATE_NEW_CONSOLE -
i have python code.
import subprocess subprocess.popen("airmon-ng check kill", creationflags = subprocess.create_new_console)
python 2.7.6 on linux mint gives me following error:
subprocess.popen("airmon-ng check kill", creationflags = subprocess.create_new_console) attributeerror: 'module' object has no attribute 'create_new_console'
the same on windows 8.1 gives me this:
traceback (most recent call last): file "c:\users\ben\dropbox\coding\jam.py", line 10, in <module> subprocess.popen("airmon-ng check kill", creationflags = subprocess.create_new_console) file "c:\python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) file "c:\python27\lib\subprocess.py", line 958, in _execute_child startupinfo) windowserror: [error 2] system cannot find file specified
subprocess.popen("airmon-ng check kill", shell=true)
will want, presume open shell , execute airmon-ng check kill
through python. i've looked through subprocess docs , thing pointing create_new_console
states creationflags
available in windows explain why doesn't work in mint. the docs create_new_console states that
the new process has new console, instead of inheriting parent’s console (the default). flag set when popen created
shell=true
.
so using shell=true
best way want.
Comments
Post a Comment