We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc7222b commit e3432e3Copy full SHA for e3432e3
1 file changed
check_ping.py
@@ -1,7 +1,8 @@
1
#!/usr/bin/python
2
+#coding:utf-8
3
import multiprocessing
4
import re
-import sys
5
+import sys,os
6
import commands
7
import datetime
8
def pinger(ip):
@@ -21,6 +22,9 @@ def pinger(ip):
21
22
23
24
if __name__ == "__main__":
25
+ if not os.path.exists("hosts.txt") :
26
+ print "\033[31mhosts.txt文件不存在,请重试\033[0m"
27
+ sys.exit(1)
28
now=datetime.datetime.now()
29
file=open('hosts.txt','r')
30
pool=multiprocessing.Pool(processes=4)
0 commit comments