Instantly share code, notes, and snippets.

Embed
What would you like to do?
tensorFlow Learning results update process , via python2.7
#import tensorflow as tf
import json
from urllib2 import urlopen
import datetime
import threading
import time
import sys
import traceback
import api_func
import ai_func
import timeZone
#define
mTimeMax =1800
def proc_learning():
clsAI =ai_func.ai_funcClass()
try:
field=1
clsAI.proc_run(field)
# field=4
# clsAI.proc_run(field)
except:
print "--------------------------------------------"
print traceback.format_exc(sys.exc_info()[2])
print "--------------------------------------------"
if __name__ == "__main__":
#cls = api_func.api_funcClass()
proc_learning()
from datetime import datetime
clsJST= timeZone.timeZoneClass()
nowJST = datetime.now(tz=clsJST )
print(nowJST )
tmBef = nowJST
while True:
time.sleep(1.0)
tmNow = datetime.now(tz=clsJST )
tmSpan = tmNow - tmBef
iSpan = tmSpan.total_seconds()
sTime = tmNow.strftime("%Y-%m-%d %H:%M:%S")
print("time=" +sTime)
if iSpan > mTimeMax:
tmBef = datetime.now(tz=clsJST )
proc_learning()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment