-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfinal_skim.py
94 lines (83 loc) · 2.03 KB
/
final_skim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#for train 12404
import os
import sys
import requests
from datetime import date, timedelta
from pprint import pprint
d1 = date(2017,1,1) # start date
d2 = date(2017, 12, 31) # end date
delta = d2 - d1
city=[]
'''
city.append('Jaipur')
city.append('Alwar')
city.append('Mathura')
city.append('Agra')
city.append('Tundla')
city.append('Kanpur')
city.append('Fatehpur')
city.append('Allahabad')
file='weather_city.csv'
f= open('12404.txt',"a+")
sys.stdout=f
for i in range(delta.days + 1):
pres_data = d1 + timedelta(days=i)
for c in city:
with open(file) as fi:
for line in fi:
if str(pres_data) in line:
if c in line:
print line,
'''
city.append('Allahabad')
city.append('Fatehpur')
city.append('Kanpur')
city.append('Aligarh')
city.append('Delhi')
file='weather_city.csv'
f= open('12417.txt',"a+")
sys.stdout=f
for i in range(delta.days + 1):
pres_data = d1 + timedelta(days=i)
for c in city:
with open(file) as fi:
for line in fi:
if str(pres_data) in line:
if c in line:
print line,
'''
city.append('Allahabad')
city.append('Lucknow')
city.append('Bareilly')
city.append('Moradabad')
city.append('Meerut')
file='weather_city.csv'
f= open('14511.txt',"a+")
sys.stdout=f
for i in range(delta.days + 1):
pres_data = d1 + timedelta(days=i)
for c in city:
with open(file) as fi:
for line in fi:
if str(pres_data) in line:
if c in line:
print line,
'''
'''
city.append('Allahabad')
city.append('Fatehpur')
city.append('Kanpur')
city.append('Aligarh')
city.append('Delhi')
file='weather_city.csv'
f= open('12275.txt',"a+")
sys.stdout=f
for i in range(delta.days + 1):
pres_data = d1 + timedelta(days=i)
for c in city:
with open(file) as fi:
for line in fi:
if str(pres_data) in line:
if c in line:
print line,
'''