def e(tt,ee):
e1=0;
if tt==8:e1=e8(ee)
if tt==9:e1=e9(ee);
if tt==101:e1=e101(ee);
if tt==102:e1=e102(ee);
if tt==71:e1=e71(ee);
if tt==72:e1=e72(ee);
return e1
def e8(ee):
z=0
if ee==728:z=100
if ee==8:z=100
if ee==89:z=100
if ee==891:z=100
if ee==78:z=100
if ee==789:z=100
return z
def e9(ee):
z=0
if ee==9:z=100
if ee==89:z=100
if ee==910:z=100
if ee==9101:z=100
if ee==789:z=100
return z
def e101(ee):
z=0
if ee==101:z=100
if ee==10:z=100
if ee==910:z=100
if ee==10111:z=100
if ee==1011:z=100
if ee==103:z=100
if ee==9101:z=100
return z
def e102(ee):
z=0
if ee==102:z=100
if ee==10:z=100
if ee==910:z=100
if ee==10111:z=100
if ee==1011:z=100
if ee==103:z=100
if ee==1021112:z=100
if ee==10211:z=100
if ee==102111:z=100
return z
def e71(ee):
z=0
if ee==71:z=100
if ee==7:z=100
if ee==78:z=100
if ee==67:z=100
if ee==627:z=100
if ee==6271:z=100
if ee==789:z=100
return z
def e72(ee):
z=0
if ee==72:z=100
if ee==7:z=100
if ee==78:z=100
if ee==67:z=100
if ee==627:z=100
if ee==789:z=100
if ee==728:z=100
return z
memo=[]
f=open("tv.csv","r",encoding='utf-8')
x=[]
for line in f:
x.append(line)
f.close()
sta=[]
y1=[]
m1=[]
y2=[]
m2=[]
w=[]
time=[]
t=[]
c=[]
for i in range(len(x)-1):
y=x[i+1].split(",")
sta.append(y[0])
y1.append(int(y[1]))
m1.append(int(y[2]))
y2.append(int(y[3]))
m2.append(int(y[4]))
w.append(y[5])
time.append(int(y[6]))
t.append(y[7])
c.append(y[9])
for stasta in ["日本","tbs","フジ","朝日","東京"]:
for tt in [71,72,8,9,101,102]:
for ws in ["月","火","水","木","金","土","日"]:
tip=[]
point=[]
for i in range(480):
tip.append("")
point.append(0)
for u in range(len(t)):
h=0
q1=12*(y1[u]-1980)+m1[u]
q2=12*(y2[u]-1980)+m2[u]
if q1<0:q1=0
if sta[u]==stasta:h=h+1
if e(tt,time[u])>50:h=h+1
if w[u]==ws:h=h+1
if h==3:
for k in range(q1,q2+1):
tip[k]=tip[k]+"△"+t[u]
point[k]=point[k]+1
for i in range(456):
yy=int(i/12)
mm=i-12*yy
yy=yy+1980
mm=mm+1
if point[i]==0:memo.append(stasta+","+str(tt)+","+ws+","+str(yy)+","+str(mm)+","+tip[i])
if point[i]>1:memo.append(stasta+","+str(tt)+","+ws+","+str(yy)+","+str(mm)+","+tip[i])
g=open("ren.txt","w",encoding='utf-8')
for line2 in memo:
g.write(line2+"\n")
g.close()
最終更新:2018年02月19日 00:26