I want to use a python script to use nmap. I realize there is a package for python-nmap. But I want to create a simple script that interprets the output of nmap command then does some more things depending on it's output.
Attempting to use check_output("nmap") like this link does:
Running shell command from Python and capturing the output
by running this :
sp.check_output(
"nmap",
stderr=sp.STDOUT)
I get the error:
CalledProcessError: Command 'nmap' returned non-zero exit status 255
The command works with apt-get, ls and python. I think it is probably that nmap is an installed program and check_output is searching in the right place to find it.
nmap works in my terminal.
Any pointers?