Advertisement
surya_adi

RandomPingGenerator

Jun 24th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import random as q
  2. import subprocess as w
  3. import datetime as e
  4.  
  5. qq = "ping test result-{}.txt".format(e.date.today())
  6. qw = "ping test error-{}.txt".format(e.date.today())
  7. with open (qq, mode='w') as r, open(qw,mode='w') as t:
  8.     for y in range(256):
  9.         a,s,d,f= q.randint(0,255), q.randint(0,255), q.randint(0,255), q.randint(0,255)
  10.         ww = 'ping {}.{}.{}.{}'.format(a,s,d,f)
  11.         print(ww)
  12.         t.write(ww)
  13.         w.call(ww,stdout=r,stderr=t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement