import re import sys from datetime import date today = [today.strftime('%Y-%m-%d'),today.strftime("%a")] mkdate(x) = x[0]+'_'+x[1] for a in range(9): print '今日干支 %s %d'%(mkdate(a), int((a+1)/7)) dt = today + ('今天', '明天','大后天') for f in zip(dt, dt[:-1], dt[1:]): if len(f[0][0]) >= 8 and sum(x > 45 for x in map(int, f[0])) < 4: yday = (yday+1) % 7 print x,'\n',y,'\n',rnd()*6666