print ( "A:%s N:%s K:%s %s G:%s" % (df_count, now_count, len(top_all), len(top_now) - len(top_all), len(top_dif)) ), print "Rt:%0.3f" % (float(time.time() - time_Rt)) if "counts" in top_dif.columns.values: top_dif = top_dif.sort_values( by=["diff", "volume", "percent", "counts", "ratio"], ascending=[0, 0, 0, 1, 1] ) else: print "Good Morning!!!" top_dif = top_dif.sort_values(by=["diff", "percent", "ratio"], ascending=[0, 0, 1]) if time_d - time_s > delay_time: time_s = time.time() # top_all=top_all.sort_values(by=['percent','diff','counts','ratio'],ascending=[0,0,1,1]) print rl.format_for_print(top_dif[:10]) # print rl.format_for_print(top_dif[-1:]) # print "staus",status if status: for code in top_dif[:10].index: code = re.findall("(\d+)", code) if len(code) > 0: code = code[0] kind = sl.get_multiday_ave_compare_silent(code) # print top_all[top_all.low.values==0] # else: # print "\t No RealTime Data" else: if sl.get_work_time_now(): # not top_now[:1].buy.values == 0
# top_all=top_all.sort_values(by=['diff','percent','counts','ratio'],ascending=[0,0,1,1]) top_all=top_all.sort_values(by=['diff','counts','ratio'],ascending=[0,0,1]) if time_d-time_s>delay_time: time_s=time.time() # top_all=top_all.sort_values(by=['percent','diff','counts','ratio'],ascending=[0,0,1,1]) # print top_all # print pt.PrettyTable([''] + list(top_all.columns)) # print tbl.tabulate(top_all,headers='keys', tablefmt='psql') # print tbl.tabulate(top_all,headers='keys', tablefmt='orgtbl') # print rl.format_for_print(top_all) # print top_all[:10] print rl.format_for_print(top_all[:10]) # print "staus",status if status: for code in top_all[:10].index: code=re.findall('(\d+)',code) if len(code)>0: code=code[0] kind=sl.get_multiday_ave_compare_silent(code) else: print "no data" time.sleep(60) except (KeyboardInterrupt) as e: # print "key" print "KeyboardInterrupt:", e