From 4351d88ed05ecc6bce46f8fb608e9591625e48fd Mon Sep 17 00:00:00 2001 From: peppelinux Date: Mon, 22 Dec 2014 00:05:41 +0100 Subject: [PATCH] modified: lanscan.py --- lanscan.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lanscan.py b/lanscan.py index a35613a..4de6f10 100644 --- a/lanscan.py +++ b/lanscan.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- + """ Author: skywebsys contact at gmail.com License: GPL v2 @@ -14,7 +16,8 @@ fin,fout=os.popen4("ip route list | grep proto | awk '{print $1}'") lan_network = fout.read() -wr = csv.writer(open('mac.csv', 'wb'), delimiter=',', quoting=csv.QUOTE_ALL) +f = open('mac.csv', 'wb') +wr = csv.writer(f, delimiter=',', quoting=csv.QUOTE_ALL) try: alive,dead=srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=lan_network), timeout=2, verbose=1) @@ -29,3 +32,6 @@ pass +f.close() + +