Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Generator

a guest Mar 13th, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import random as rnd
  2. import sys
  3.  
  4.  
  5. def main(count):
  6.     if len(sys.argv) != 2:
  7.         print("usage: python3 generator.py <output filename>")
  8.         return
  9.  
  10.     _10percent = count * 0.1  
  11.          
  12.     with open(sys.argv[1], 'w') as f:  
  13.         for i in range(count):
  14.             f.write('{}\t{}\t{}\t{}\n'.format(i, rnd.random(), rnd.random(), rnd.random()))
  15.             if i % _10percent == 0:
  16.                 print('{}%'.format(i / _10percent *  10))
  17.                
  18.                 if i / _10percent *  10 == 90:
  19.                     print('Подождите, мужики, тут еще крапаль остался')
  20.            
  21. if __name__ == "__main__":
  22.     main(1000000)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top