Re: python nmap for loop

2017-06-14 Thread Skip Montanaro
> I'm trying to make the following code work: > ... It seems fairly clear that you've posted code which couldn't possibly run (missing a closing quote and right paren). Let me suggest: 1. You copy and paste directly from a Python (or IPython/Jupyter/IDLE) session, including prompts and output. 2

python nmap for loop

2017-06-14 Thread SS
I'm trying to make the following code work: import os, sys app=['host1', 'host2', 'host3'] for i in app: os.system('nmap -p 22 -P0 %s | grep open 2>&1 > /dev/null && echo "%s up" I've tried many different iterations of the os.system call, how to make this work? TIA -- https://mail.pytho