def leader(): #前置處理 #設定應存放資料表 global newSQLlistname newSQLlistname=datetime.datetime.now().strftime('%Y-%m-%d') #確定應存放資料表存在與否,決定做選取或是新增 try: SQL.newlist(newSQLlistname) print "創新資料表:"+newSQLlistname except: SQL.clear(newSQLlistname) print "重製資料表:"+newSQLlistname #更新開啟(重製)程式時間 global startday startday = datetime.datetime.now().strftime('%d') global starttime starttime = datetime.datetime.now().strftime('%H:%M:%S') #清除主測表中過時(非今日)資訊 ''' print str(fetchdata[0][1].day) print str(datetime.datetime.now().day) ''' fetchdata = SQL.catchdbfetch(1) if SQL.catchidnum()!=0: if fetchdata[0][1].day!=datetime.datetime.now().day: SQL.clear('detect') print '清除過時資訊'
def post(): try: SQL.clear('detect') SQL.copyttodetect('tem') SQL.clear('tem') print 'reset success' except: print 'reset error'
def leader(name): #清空暫時存資料表 SQL.clear('tem') #將主資料表所有資料轉至暫存資料表 SQL.copytonewlist('tem') #清空主資料表 SQL.clear('detect') #將要分析之資料表轉至主資料表 SQL.copyttodetect(str(name))