1-button 7 random

import random

import time

import numpy as np

sumtime = 0

display_num = random.randint(0,10) ## 产生 1 到 10 的一个整数型随机数

flag=1;

while flag:

for i in range(0,100,5):

display_num = display_num + 1

display_num = display_num % 10

sumtime = np.tanh(i/100)

print("This prints ==> ." ,sumtime," Num:",display_num)

#addtime = random.uniform(0,0.01)

#sumtime = sumtime + addtime

time.sleep(sumtime) # Delay for 1 minute (60 se

if sumtime > 0.7:

flag = 0

break

print("End of run")