Skip to content

Instantly share code, notes, and snippets.

@ArneSwinnen
Created February 10, 2016 01:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ArneSwinnen/124aaae3390c444e4763 to your computer and use it in GitHub Desktop.
Save ArneSwinnen/124aaae3390c444e4763 to your computer and use it in GitHub Desktop.
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