wifi-probe.py 文件源码

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

项目:wifi-probe 作者: danrl 项目源码 文件源码
def print_probes():
    termx, termy = get_termsize()
    col1_width = termx // 2
    col2_width = termx - col1_width - 1
    DISPLAY_PROBES_MAX = termy - 2
    print TERM_RESET + TERM_POS_ZERO + str(datetime.now()).center(termx)
    for i in range(len(probes)):
        probe = probes[i]
        # ssid
        out = ''
        out += TERM_BOLD
        age = (datetime.now() - probe['last_seen']).total_seconds()
        if age < 60:
            out += TERM_RED
        elif age < 180:
            out += TERM_YELLOW
        else:
            out += TERM_GREEN
        out += probe['ssid'].rjust(col1_width)
        # time
        out += ' '
        out += TERM_RESET + TERM_BLUE
        out += humanize.naturaltime(probe['last_seen']).ljust(col2_width)
        print out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号