Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import datetime
- q = datetime.date(2018,6,11)
- #w = datetime.date.today()
- w = datetime.date(2018,6,25)
- e = (w-q)
- title='F:/rand-num-{}.txt'.format(w)
- with open(title,mode='w',encoding='utf-8') as p:
- p.write("tanggal \t masuk \t keluar\n")
- for r in range(e.days+1):
- t = q+datetime.timedelta(days=r)
- a=random.randint(7,8)
- if a == 7:
- s = random.randint(50,59)
- else:
- s = random.randint(0,15)
- d,f=random.randint(16,17),random.randint(0,59)
- p.write("{} \t {}:{} \t {}:{}\n".format(t,a,s,d,f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement