티스토리 뷰
def Test12(weatherStation1):
#weatherStation1 = WeatherStationList[0]
print(weatherStation1)
startTime = theBeginning
endTime = startTime + timedelta(days=30)
startTimeString = startTime.strftime('%Y-%m-%d')
endTimeString = endTime.strftime('%Y-%m-%d')
isFileCreated = False
dataLength = 0
while(True):
weatherData1 = LoadWeatherDatas(weatherStation1['StationCode'], startTimeString, endTimeString)
if weatherData1:
if not isFileCreated:
filename = "E:/tttt/"+weatherStation1['StationCode']+"_AllData01.csv"
file1 = open(filename, "w")
weatherData1 = LoadWeatherDatas(weatherStation1['StationCode'], startTimeString, endTimeString)
print(weatherData1[0].keys())
#print(weatherData1)
aWeatherData = weatherData1[0]
keys1 = aWeatherData.keys()
for key1 in keys1:
if(key1=="iscs"): continue
file1.write(key1+',')
file1.write('\n')
isFileCreated = True
for aWeatherData in weatherData1:
for key1 in keys1:
if(key1=="iscs"): continue
file1.write(aWeatherData[key1]+',')
file1.write('\n')
dataLength += len(weatherData1)
print(weatherData1[0]['tm'], "(",len(weatherData1),")")
if(endTime >= theNow): break
startTime = endTime + timedelta(days=1)
endTime = startTime + timedelta(days=60)
startTimeString = startTime.strftime('%Y-%m-%d')
endTimeString = endTime.strftime('%Y-%m-%d')
print(startTimeString, " to ", endTimeString)
if isFileCreated: file1.close()
def Test13():
weatherStation1 = WeatherStationList[0]
startIndex = 1
index1 = 0
for weatherStation1 in WeatherStationList:
if(index1 < startIndex):
index1+=1
continue
Test12(weatherStation1)
index1+=1
Test13()
반응형
'SWDesk > App' 카테고리의 다른 글
[Python] NAS와 파일 공유하기(1) (0) | 2020.11.06 |
---|---|
[Python] 파일에서 데이터 읽기 (0) | 2020.10.25 |
[Python] OpenAPI06-1, 테스트용 (0) | 2020.10.24 |
[Python] DB에서 데이터 불러오기 (0) | 2020.10.24 |
[Python] OpenAPI05-3, DB 중복 데이터 제거 (0) | 2020.10.23 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- bilient
- 혁신
- BSC
- DYOV
- 아두이노
- 배프
- Video
- Innovation&Hurdles
- 전압전류모니터링
- 티스토리챌린지
- 치매방지
- arduino
- 치매
- 혁신과허들
- 절연형
- ServantClock
- Innovations
- 오블완
- Decorator
- 심심풀이
- Hurdles
- image
- 빌리언트
- Innovations&Hurdles
- 심심풀이치매방지기
- 허들
- 전류
- 둎
- 전압
- badp
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함