Advertisement
here2share

# continue_seed.py

Jun 3rd, 2024
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. # continue_seed.py
  2.  
  3. import random
  4. import time
  5.  
  6. RND__ = str(random.randint(1000, int('9'*99)))
  7. def continue_seed():
  8.     t = RND__
  9.     for _ in '.'*200:
  10.         t += str(time.perf_counter()).replace('.','')[6:]
  11.     t = int(t)
  12.     print(t)
  13.     random.seed(t)
  14.  
  15. def rnd_gen(seed=-1):
  16.     if seed != -1:
  17.         random.seed(12345)
  18.         print('SEED =', seed)
  19.     for i in range(10):
  20.         num1 = random.randint(1000, 9999)
  21.         print(num1, end=' ')
  22.     print('\n')
  23.  
  24. # set the initial seed value
  25. continue_seed()
  26.  
  27. rnd_gen()
  28.  
  29. rnd_gen(12345)
  30.  
  31. continue_seed()
  32.  
  33. rnd_gen()
  34.  
  35. rnd_gen(12345)
  36.  
  37. continue_seed()
  38.  
  39. rnd_gen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement