Instantly share code, notes, and snippets.

@ArneSwinnen /loop.py Secret
Created Feb 10, 2016

Embed
What would you like to do?
loop.py
# -*- coding: utf-8 -*-
import os
import datetime
from time import sleep
starttime = datetime.datetime.now()
print "starttime: " + str(starttime)
good = 0
bad = 0
goodarray = []
badarray = []
while True:
time = datetime.datetime.now()
ret = os.system("python login.py")
if ret == 0:
good = good + 1
goodarray.append(time)
print "[" + str(time) + "] Good one"
else:
bad = bad + 1
badarray.append(time)
print "[" + str(time) + "] Bad one"
print "-----------------------"
print "Good: " + str(good)
for i in goodarray:
print str(i)
print "Bad: " + str(bad)
for i in badarray:
print str(i)
print "Sleeping 6 minutes.."
sleep(60*6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment