tracker.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:nav 作者: UNINETT 项目源码 文件源码
def scan(addresses):
    """Scan a list of ip-addresses for netbios names"""

    _logger.debug('Scanning %s addresses', len(addresses))
    proc = Popen(['nbtscan', '-f-', '-s', SPLITCHAR], stdin=PIPE, stdout=PIPE)
    stdout, stderr = proc.communicate('\n'.join(addresses))
    if stderr:
        raise Exception(stderr)

    if isinstance(stdout, six.binary_type):
        stdout = stdout.decode('cp850')  # cp850 seems like netbios' standard

    _logger.debug('Result from scan:\n%s', stdout)
    return stdout
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号