-
-
Save ArneSwinnen/124aaae3390c444e4763 to your computer and use it in GitHub Desktop.
loop.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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