Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess as q
- import datetime as w
- qq = "pinghostresult-{}.txt".format(w.date.today()) #output if run (hopefully)
- qw = "pinghosterror-{}.txt".format(w.date.today()) #output if run (shit!)
- e = open('E:/host.txt', mode='r') # input
- ee = e.readlines()
- with open (qq, mode='wb') as r, open(qw,mode='wb') as t:
- for a in ee:
- ww = 'ping {}'.format(a)
- print (ww)
- q.call(ww,stdout=r,stderr=t)
- e.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement