whosonline/asyncio_prompt.py
async def nmap_scan_loop(network, no_dns):
    """
    Coroutine calling fast nmap scan for all known hosts
    """
    while True:
        ip_hosts = await get_hosts(network, no_dns)
        print('%s hosts in network %s' % (len(ip_hosts), network))
        for ip, host_d in ip_hosts.items():
            scan_result = await nmap_scan(ip)
            print()
            print('HOST %s SCANNED, RESULT FOLLOWS:' % host_d['hostname'])
            print(pprint.pformat(scan_result))
            print()
            online = scan_result['online']
            # print('%s online: %s' % (host_d['hostname'], online))
            ports = scan_result['ports']
            # for port_d in ports:
            # print(port_d)
            await asyncio.sleep(1)

        await asyncio.sleep(3)

    Coroutine calling fast nmap scan for all known hosts
    
Coroutine calling fast nmap scan for all known hosts
Coroutine calling fast nmap scan for all known hosts
async def nmap_scan_loop(network, no_dns):
    while True:
        ip_hosts = await get_hosts(network, no_dns)
        print('%s hosts in network %s' % (len(ip_hosts), network))
        for ip, host_d in ip_hosts.items():
            scan_result = await nmap_scan(ip)
            print()
            print('HOST %s SCANNED, RESULT FOLLOWS:' % host_d['hostname'])
            print(pprint.pformat(scan_result))
            print()
            online = scan_result['online']
            ports = scan_result['ports']
            await asyncio.sleep(1)
        await asyncio.sleep(3)
async def nmap_scan_loop ( network , no_dns ) : while True : ip_hosts = await get_hosts ( network , no_dns ) print ( '%s hosts in network %s' % ( len ( ip_hosts ) , network ) ) for ip , host_d in ip_hosts . items ( ) : scan_result = await nmap_scan ( ip ) print ( ) print ( 'HOST %s SCANNED, RESULT FOLLOWS:' % host_d [ 'hostname' ] ) print ( pprint . pformat ( scan_result ) ) print ( ) online = scan_result [ 'online' ] ports = scan_result [ 'ports' ] await asyncio . sleep ( 1 ) await asyncio . sleep ( 3 )
Coroutine calling fast nmap scan for all known hosts
Coroutine calling fast nmap scan for all known hosts
"""
    Coroutine calling fast nmap scan for all known hosts
    """ # print('%s online: %s' % (host_d['hostname'], online)) # for port_d in ports: # print(port_d)
network
no_dns