Advertisement
surya_adi

PingSweep.py

Jun 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import subprocess as q
  2. import datetime as w
  3.  
  4. qq = "pinghostresult-{}.txt".format(w.date.today()) #output if run (hopefully)
  5. qw = "pinghosterror-{}.txt".format(w.date.today()) #output if run (shit!)
  6.  
  7. e = open('E:/host.txt', mode='r') # input
  8. ee = e.readlines()
  9. with open (qq, mode='wb') as r, open(qw,mode='wb') as t:
  10.     for a in ee:
  11.         ww = 'ping {}'.format(a)
  12.         print (ww)
  13.         q.call(ww,stdout=r,stderr=t)
  14. e.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement