|
@@ -1,4 +1,63 @@
|
1
|
|
-import requests
|
2
|
|
-response = requests.get('http://naver.com')
|
3
|
|
-html = response.text
|
4
|
|
-print(html)
|
|
1
|
+def totalDayFromCalendar(year, month, day):
|
|
2
|
+ dayOfMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30]
|
|
3
|
+ i=1
|
|
4
|
+ totaldays = 365 * (int(year) - 1)
|
|
5
|
+ while i<year:
|
|
6
|
+ if i % 4 == 0 and i % 100 != 0 or i % 400 == 0:
|
|
7
|
+ totaldays+=1
|
|
8
|
+ i += 1
|
|
9
|
+ premonth = month - 1
|
|
10
|
+ for b in range(len(dayOfMonth)):
|
|
11
|
+ if premonth >= (b+1):
|
|
12
|
+ totaldays += dayOfMonth[b]
|
|
13
|
+ if (month > 2 and year % 4 == 0 and year % 100 != 0 or year % 400 == 0):
|
|
14
|
+ totaldays +=1
|
|
15
|
+ totaldays +=1
|
|
16
|
+ totaldays = totaldays + day
|
|
17
|
+ return totaldays
|
|
18
|
+
|
|
19
|
+def endDayFromTotalDay(year, month):
|
|
20
|
+ if month == 2:
|
|
21
|
+ lastday = 28
|
|
22
|
+ if (year % 4 == 0 and year % 100 != 0 or year % 400 == 0):
|
|
23
|
+ lastday = 29
|
|
24
|
+ else:
|
|
25
|
+ lastday = 28
|
|
26
|
+ else:
|
|
27
|
+ if month == 4 or month == 6 or month == 9 or month == 11:
|
|
28
|
+ lastday = 30
|
|
29
|
+ else:
|
|
30
|
+ lastday = 31
|
|
31
|
+ return lastday
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+start = input("시작일:")
|
|
35
|
+end = input("끝일:")
|
|
36
|
+st_year=int(start[:4])
|
|
37
|
+st_mon=int(start[4:6])
|
|
38
|
+st_day=int(start[6:])
|
|
39
|
+end_year=int(end[:4])
|
|
40
|
+end_mon=int(end[4:6])
|
|
41
|
+end_day=int(end[6:])
|
|
42
|
+
|
|
43
|
+st_total=totalDayFromCalendar(st_year, st_mon, st_day)
|
|
44
|
+end_total=totalDayFromCalendar(end_year, end_mon, end_day)
|
|
45
|
+
|
|
46
|
+while st_total <= end_total:
|
|
47
|
+ st_end_day = endDayFromTotalDay(st_year, st_mon);
|
|
48
|
+ if st_day > st_end_day:
|
|
49
|
+ st_mon+=1
|
|
50
|
+ st_day=1
|
|
51
|
+ if st_mon > 12:
|
|
52
|
+ st_year+=1
|
|
53
|
+ st_mon=1
|
|
54
|
+ st_day=1
|
|
55
|
+ if st_mon<10:
|
|
56
|
+ st_mon = "0"+ str(st_mon)
|
|
57
|
+ if st_day<10:
|
|
58
|
+ st_day = "0"+ str(st_day)
|
|
59
|
+ print(str(st_year) + str(st_mon) + str(st_day))
|
|
60
|
+ st_day = int(st_day)+1
|
|
61
|
+ st_mon = int(st_mon)
|
|
62
|
+ st_total+=1
|
|
63
|
+
|