tag:blogger.com,1999:blog-89010791062979054492024-02-20T00:30:41.841+09:00BloBlogAnonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.comBlogger78125tag:blogger.com,1999:blog-8901079106297905449.post-49634072341121414602018-02-07T11:14:00.000+09:002018-02-07T15:56:40.974+09:00키보드 한글 / 영문 변환 키 바꾸기<span id="docs-internal-guid-aabb7c59-6e0a-2ac0-1423-769b4dc01d57"></span><br />
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span id="docs-internal-guid-aabb7c59-6e0a-2ac0-1423-769b4dc01d57"><span style="color: #695d46; font-family: "open sans"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"></span></span></div>
<span id="docs-internal-guid-aabb7c59-6e0a-2ac0-1423-769b4dc01d57">
</span>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span id="docs-internal-guid-aabb7c59-6e0a-2ac0-1423-769b4dc01d57"><span style="color: #695d46; font-family: "pt sans narrow"; font-size: 30pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">키보드 한글 / 영문 변환 키 바꾸기</span></span></div>
<span id="docs-internal-guid-aabb7c59-6e0a-2ac0-1423-769b4dc01d57">
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 18pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">─</span></div>
<h1 dir="ltr" style="line-height: 1.56; margin-bottom: 0pt; margin-top: 24pt; text-align: justify;">
<span style="color: #ff5e0e; font-family: "pt sans narrow"; font-size: 18pt; vertical-align: baseline; white-space: pre-wrap;">들어가기</span></h1>
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">대부분의 키보드는 ‘한/영’ 키를 가지고 있습니다. 대부분의 윈도우즈 사용자는 그 키를 사용해서 한글과 영문 사이를 왔다갔다 합니다. MAC 사용자는 ‘^(control) + space’ 혹은 ‘⌘(Cmd) + Space’를 조합해서 사용합니다. 운영체제에서 이미 그렇게 사용하도록 설정되어 있기 때문에 그렇게 사용하는 것입니다. 하지만 윈도우즈는 약간의 배려(?)로 사용자가 한글 / 영문 변환을 제한적이나마 선택할 수 있도록 해주었습니다. 그래봐야 4가지 중에 고르는 것이지만 저는 개인적으로 만족합니다. 왜냐하면 ‘L shift + space’로 변환할 수 있기 때문입니다. 참고로 이 글은 </span><span style="color: #695d46; font-family: "open sans"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Windows 10</span><span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">을 기준으로 작성되었습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.56; margin-bottom: 0pt; margin-top: 24pt; text-align: justify;">
<span style="color: #ff5e0e; font-family: "pt sans narrow"; font-size: 18pt; vertical-align: baseline; white-space: pre-wrap;">어디서 어떻게 바꾸나?</span></h1>
<h2 dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #008575; font-family: "pt sans narrow"; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;">설정 - 지역 및 언어 - 국가 또는 지역 - 하드웨어 키보드 레이아웃</span></h2>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="497" src="https://lh4.googleusercontent.com/5yOgt5ybwm1dyB6wf9V91wGaJH6EzMyNVEH84JZhSbz8JLCYqtqpnluh3FwGYxHjzlrBVoyzILLOhpVrITIBH-oLKybqRtUVRrQDz8X3S7NBH_lrf3KX_DktBe-Ne0v8H4NigiW9" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">제가 윈도우즈 영문판을 사용하는 점 양해바랍니다. 따라하기에는 전혀 문제 없을 것입니다.</span></div>
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">위 이미지에서 볼 수 있듯이 옵션을 선택합니다. 그럼 다음 화면을 볼 수 있을 것입니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="682" src="https://lh3.googleusercontent.com/GYQ4Uel87EVZJ6DJN6965S7Gt2-W10-kLw91KsyIxNcOAs87Cjfg_B_belXLkrJXfYryyGjjRgX_LW0GYFP5h5mNhA4owby4Ry-vGKgTfe3hDykKPWq2nejbmBTQVF1NyJSt1bWT" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="403" /></span></div>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">키보드 레이아웃을 보일 것입니다. 저는 현재 ‘Korean Keyboard (101 key) Type 3’으로 설정되어 있습니다. 이제 레이아웃을 바꿔보겠습니다. ‘레이아웃 변경’을 클릭합니다. 그럼 다음과 같은 선택 항목이 뜰 것입니다.</span></div>
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="275" src="https://lh3.googleusercontent.com/LByFrMpSw9h3NmmbojK3bTJDPDgOVx-04Mve24JciwHpOL2ppIK0zKf8jJE38YJBbCZ5JsXaXi4keG19rhQZ0XZJ_gurAQ24y4C7FZcOYND7mPlDmKYdwI6hj69ChCvCR_86jW2n" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">각 레이아웃 별로 ‘한 / 영 변환’, ‘한자’ 키가 무엇인지 볼 수 있습니다. 레이아웃별 키 목록은 아래 표와 같습니다.</span></div>
<br /><div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none; width: 468pt;"><colgroup><col width="*"></col><col width="*"></col><col width="*"></col></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #ff9900; border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #695d46; font-family: "open sans"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">레이아웃</span></div>
</td><td style="background-color: #ff9900; border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #695d46; font-family: "open sans"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">한 / 영 변환</span></div>
</td><td style="background-color: #ff9900; border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #695d46; font-family: "open sans"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">한자</span></div>
</td></tr>
<tr style="height: 0pt;"><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">103/106 Key</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">‘한/영’ 키</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">‘한자’ 키</span></div>
</td></tr>
<tr style="height: 0pt;"><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">101 Key Type 1</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">우측 Alt</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">우측 Ctrl</span></div>
</td></tr>
<tr style="height: 0pt;"><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">101 Key Type 2</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">우측 Ctrl</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">우측 Alt</span></div>
</td></tr>
<tr style="height: 0pt;"><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">101 Key Type 3</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Shift + Space</span></div>
</td><td style="border-bottom: solid #000000 1pt; border-left: solid #000000 1pt; border-right: solid #000000 1pt; border-top: solid #000000 1pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Ctrl + Space</span></div>
</td></tr>
</tbody></table>
</div>
<br /><div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">원하는 레이아웃을 선택한 후, ‘로그 아웃’ 합니다. 그리고 다시 로그인 하면 ‘한 / 영 변환’키가 바뀐 것을 확인할 수 있을 것입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.56; margin-bottom: 0pt; margin-top: 24pt; text-align: justify;">
<span style="color: #ff5e0e; font-family: "pt sans narrow"; font-size: 18pt; vertical-align: baseline; white-space: pre-wrap;">나가기</span></h1>
<div dir="ltr" style="line-height: 1.44; margin-bottom: 0pt; margin-top: 6pt; text-align: justify;">
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">윈도우즈 10에서 간단하게 ‘한 / 영 변환’과 ‘한자’키를 변경하는 방법을 알아보았습니다. 개인적으로 ‘101 Key Type 3’을 가장 좋아합니다. 커스텀 키보드에 자신만의 레이아웃을 적용하고 싶은 분들에게도 ‘101 Key Type 3’을 추천합니다. 우측 Alt, 우측 Ctrl처럼 사용 빈도가 낮은 키에 자신이 원하는 매크로를 등록할 수 있기 때문입니다. 그럼 이것으로 마무리하겠습니다.</span></div>
<div>
<span style="color: #695d46; font-family: "open sans"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</span>Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com1tag:blogger.com,1999:blog-8901079106297905449.post-80898567170865512632018-02-06T15:47:00.002+09:002018-02-06T15:48:21.033+09:00Devlin K 시리즈 키캡<span id="docs-internal-guid-9d6cbc30-69da-5aba-c039-6525e4736872"></span><br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span id="docs-internal-guid-9d6cbc30-69da-5aba-c039-6525e4736872">
<span style="font-family: "consolas"; font-size: 20pt; vertical-align: baseline; white-space: pre-wrap;">Devlin K 시리즈 키캡</span></span></h1>
<span id="docs-internal-guid-9d6cbc30-69da-5aba-c039-6525e4736872">
</span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: center;">
<span id="docs-internal-guid-9d6cbc30-69da-5aba-c039-6525e4736872"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="695" src="https://lh6.googleusercontent.com/uIxcyGL6NCL5u3-VHIm1_QvxPGJTyoqoDvhwHdEqZ5KHqt-qvrsqGDUvAGOUnrVV3iI4rCp3pFGRZsZhsfepp284ToGKoPRVh19hw78XSFDCIDdF3KyPfo2jeC8rQyzpcs5QSKMg" style="border: none; transform: rotate(0rad);" width="624" /></span></span></div>
</div>
<span id="docs-internal-guid-9d6cbc30-69da-5aba-c039-6525e4736872">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">http://www.mechsupply.co.uk/product/devlin-k-series-aurora-planck-keyset</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">커스텀 기계식 키보드는 키캡으로 완성됩니다. 수많은 종류의 키캡이 다양한 디자인으로 끊임없이 생산되고 있습니다. 체리, OEM, DSA, SA, XDA 등 다양한 프로파일이 있습니다. 그 밖에도 유명하지 않지만, 소수의 마니아들이 선호하는 독특한 키캡도 있습니다. 오늘 소개하고자 하는 키캡도 유명하지는 않지만 높은 완성도와 엄청난 두께를 자랑합니다. 저는 엄청난 두께를 보고 호기심이 생겨서 주문하게 되었습니다. 마침 저의 Planck 키보드 전용으로 키캡이 공동구매를 진행 중이어서 망설임없이 주문하였습니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh4.googleusercontent.com/6NZCv5Wp0TkNBDFywZJuz7HC-JTKpH0Co6RALj0vVJSguqncXJD3S0aEXwz-Djy_yOtLJeRIbRqw70xge2gLKnc6Wm_CYH83syYJPP-sLyCcL-CGJbLowBBtj3ZLw3QGIvpGSXG7" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">재질 및 인쇄 방식</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">ABS 이색사출</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;"><img height="624" src="https://lh3.googleusercontent.com/CRpfCzGelGuYxQQ71kuEBhYObdAtEWzuRjxSzX7NkxcCb9-MGfruuICF-42ET9Mk9zMyWYHfLLREOOR3XzqOMJ2K3ziFRBxLaa1XFDEVrwBXlIqclf2w-NsaDAEbTA1GO-iU6vSA" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></h2>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">키캡 기울기</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/GoA-UNfuyAAi1s5JQDMUmbKnUWmVKq28IGwVV_iKWAJFrpqbh1ezpCkOWvx_DlkgQV2YXr-XMfI15hiDopk7eyiRqJAEGJYtX5n6_BEZoJ_4Jfxcl3kkZkqVesGKfmfaqriC-r5q" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Devlin K 시리즈의 가장 큰 특징은 SA 프로파일 3번째 줄 키캡과 유사한 키캡으로만 구성되어 있다는 점입니다. 다음 그림을 보면 좀더 쉽게 확인할 수 있습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">SA 프로파일은 기본적으로 곡선을 이루고 있습니다. 이 곡선형 키캡 배열 덕분에 좀더 편하게 키캡을 누를 수 있습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Devlin K 시리즈는 이 곡선은 제거하였습니다. Planck 키보드와 같은 작은 크기의 키보드는 곡선형 키캡 배열이 아니더라고 큰 불편함 없이 사용할 수 있습니다. 그래서 Devlin K 시리즈는 SA 프로파일 중 3번째 줄 키캡만 가지고 모든 키캡을 채웠습니다. 3번째 줄과 유사한 이유는 가장 평평하기 때문입니다. 다시 말해 SA 키캡 특유의 기울기가 없습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">높이</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">앞에서 설명했듯이 이 키캡은 SA 프로파일 3번째 줄 키캡과 유사합니다. 아쉽게도 저는 SA 프로파일 키캡을 가지고 있지 않기 때문에 직접 비교할 수는 없습니다. 구글링한 결과, 높이는 거의 동일하였습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">두께</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh6.googleusercontent.com/mmN3v88ImeFFgFvpbWm6fLwNgd5MHM5MaxMa3_K6Ly6lRBXwY4jHiX-TsWYJfnyokFfZve8cE9iFv27wffkRamYP94HvuD4UReoNJ3PXzXwcBnoZqPgv4ekLiiS6gaWSWJ2oqshj" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">이 키캡을 선택한 첫 번째 이유는 바로 두께 때문이었습니다. 얇은 키캡은 키를 누를 때 좀더 경쾌한 느낌을 줍니다. 체리 갈축 스위치를 사용하더라도 얇은 두께의 키캡을 사용하면 갈축 특유의 턱을 넘는 느낌은 좀더 선명하게 느낄 수 있습니다. 반면에 두꺼운 키캡을 사용할 수록 턱을 넘는 느낌은 점점 부드러워 집니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">두께는 키보드에서 발생하는 소리에도 큰 영향을 미칩니다. 얇은 키캡일수록 경쾌하고 가볍고 높은 소리가 발생합니다. 두꺼운 키캡일수록 반대의 효과를 얻을 수 있습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">그래서 저는 두꺼운 쪽으로 끝을 경험해보고 싶었습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">키캡 윗면</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/BA_umPY8ZFg2qVUQwupEnhFBkxwwCK0S9YV0JiU_SKfRC76eJpS11GJjCsP5X1mR--WF0PU3IVhPAiE15o6NlzrSH2n8Tu_l6lzBDgOqzUoy3hai_RzOMMsvcSnQaq83odzs1nMC" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">높이는 동일하지만 손가락이 닿는 키캡 윗면은 SA 프로파일 키캡보다 넓습니다. XDA보다는 좁지만, DSA보다는 넓습니다. XDA만큼 넓다는 느낌은 아니지만 일반 체리, OEM과 비교하면 충분히 넓어서 쉽게 눌러진다고 느낄 수 있을 것입니다. 하지만 체리 혹은 DSA의 오밀조밀한 느낌을 선호하는 사람이라면 약간 둔하다는 느낌을 받을 수도 있을 것입니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">색상</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">제품명에서 알 수 있듯이 이 키캡은 오로라 색상입니다. 보통의 파란색과는 다르게 약간의 녹색을 띠고 있습니다. 오로라 사진을 보면 오묘하게 녹색이 섞인 파란색을 볼 수 있습니다. 이 키캡은 이 색상을 충분히 잘 표현하고 있습니다. 촌스러운 파란색일까봐 좀 불안하기도 하였지만, 수령 후 색상을 보자마자 만족하였습니다. 기대했던 오묘하고 희소한 색감을 잘 살렸습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">스마트폰 카메라와 집 조명의 한계 때문에 오묘한 키캡의 색상이 제대로 표현되지 못했습니다. 공식 판매처의 이미지인 첫 사진이</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">특이사항</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><img height="189" src="https://lh3.googleusercontent.com/uqe40enh4bUfY6zXouJhx-6kdqufaztNgiSogjX1QVIrU2EMpK789U1Oc9yKaI8aLIficBX0ZIj68XfvBC0DzdnvZsgLe_a3qcIRca2cONTq3p7sh2Sy6ScQinS4yFB33JIRaIs_" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">개인적으로 매우 좋아하는 GMK QMX-Clip Sound-Dampening Bracket과 호환되지 않습니다. 이 키캡 특유의 두께 때문에 완전히 눌러지지 않는 문제가 있습니다. 사실 이 키캡과 GMK QMX-Clip Sound-Dampening Bracket을 함께 사용하면 부드러움과 저소음을 한꺼번에 얻을 수 있을 것으로 기대하고 있었습니다. 아쉽지만 결론은 불가능하다는 점입니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="font-family: "consolas"; font-size: 16pt; vertical-align: baseline; white-space: pre-wrap;">사용 후기</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Devline K 시리즈는 제가 사용해본 키캡 중에 가장 두껍습니다. 아마도 현재 구매 가능한 키캡 중에 가장 두꺼울 것입니다. 현재 사용 중인 키보드는 알루미늄 케이스와 철제 플레이트(보강판)로 구성된 Planck 키보드입니다. 스위치는 Ergo Clear(체리 클리어 스템 + 55g 스프링)입니다. 기존 보통 두께의 XDA, DSA 키캡과 비교하면, 좀더 부드러운 느낌을 줍니다. 가장 두꺼운 키캡이라는 점 때문에 지나치게 극적인 변화를 기대해서 그런지 처음에는 약간 실망스러웠습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">하지만 이전과는 다른 부드러운 느낌과 독특한 키보드 치는 소리 때문에 조금씩 재미를 느끼고 있습니다. 사실 이 글도 좀더 많이 사용해보기 위해서 의도적으로 작성 중입니다. Ergo Clear 특유의 턱을 넘는 느낌이 조금 부드러워졌으며, 키보드의 소리는 정갈하고 차분한 느낌을 줍니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">제가 좋아하는 키보드 리뷰어가 이 키캡을 테스트하는 리뷰 영상을 올려둔 것이 있습니다. 스프링만 다르고 모든 조건이 동일한 상태에서 키보드 소리를 테스트한 영상이 있습니다. 참고하시길 바랍니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
</span><br />
<div style="text-align: center;">
<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/PUTSRaAz5NU" width="560"></iframe></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-88200777486246058012017-11-30T12:21:00.000+09:002017-11-30T12:21:34.064+09:00오렌지 Planck 키보드<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">오렌지 Planck 키보드 + 엠스톤 치즈 DSA 키캡 + KDB Fans DSA 키캡</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">엠스톤 블루치즈 DSA와 가지고 있던 KDB Fans의 알록달록 DSA를 조합하면서 오렌지 Planck 키보드와 잘 어울린 것 같다는 생각을 했습니다. 키캡의 전체적인 톤과 키보드 케이스의 색상이 무난하게 잘 어울릴 것 같았습니다. 전에는 치즈색 키캡과 녹색 케이스 조합이라서 어울린다기보다는 대비되는 느낌이 강해서 아쉬웠습니다.</span></div>
<b id="docs-internal-guid-5ffdc028-0aed-c8ea-ff35-7e8f15189739" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저, 오렌지 Planck 키보드 케이스입니다. 사진에는 잘 드러나지 않지만 표면이 거슬거슬합니다. olkb.com에서 직접 구매한 제품은 마감을 일부러 매끈하고 광택이 나게 하지 않는것 같습니다. 그래도 색상은 그윽해서 나름의 매력이 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh6.googleusercontent.com/BOXAFZsOk_DnqRNQ0cbYg0Ovyr2KA55wRPnM1_NfDC67Hm2hT2lAtIz8AiyZWNOjvDoqGVDjCaBSeTNW8e9JGzD3GEcsE6mJYcnb7JThOJMUp6L4mvRmYMih77_UuZuU-lV6S_Bu" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">엠스톤 치즈 DSA 키캡 + KDB Fans DSA 키캡입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/8-yklLX_8MMuerAbqEJsa3Z7GsfM4wygR2iCj-b6QRS7c4nY8YhYeLw_1WuvLbibeRoGNGtbHXIAbF935_vYOh8X1jWdzXSv3pkg21spoQ4IRURh2Vo-z6vyS3D9OpAs2ntGLbDT" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">오렌지색 케이스와 얼마나 잘 어울리는지 살펴보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/PEuAWv8mXLwogjwAihoIMKb2zaDiOdXkSlEf38Q1K_4avILZXJFQ-umeDJPdiaVX9R9GRd1i_5VZXyfVnMs5nRFvvNwZt8ifSwcGmXdvGaZrUB3jlkBcCjFO0G7zEtfQDY9hTnAh" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이런 느낌입니다. 크게 어색하지 않고 무난하게 잘 어울립니다.</span></div>
<b style="font-weight: normal;"><br /></b><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/tDyaZ3bU5cdOe53IV_UHzMKXY5B48UBB5jjOIVBAe3ABhGJSRzhXlgZUBiSVZ2V1goNkKFl42C4ZSsqKzrizk7W7TqJn6d9aZCzzHjclaSNbzsWnA_zXGuH4lcpIGshZnCAslzpu" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">부담스럽지 않은 가격에 케이스와 잘 어울리는 키캡을 사용할 수 있어서 즐겁네요. 이렇게 케이스에 독특한 색상이 들어가 있는 경우 한번 시도해보면 산뜻한 느낌을 받을 수 있어서 좋습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/Qsi5ErhG50DypcQLqB51JxFfehReteGeCFtp01jL5YKvkTxR69LjPTOCXc6vy1b9Vv6TkAJ8AbsFQaHJHb-HUERMeyN3RFqO0UELIzbjuVZOZ7-mzH5Segl87ycCqZgl66rdo6bh" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에는 녹색 Planck에 어울리는 DSA 조합으로 다시 돌아오겠습니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com3tag:blogger.com,1999:blog-8901079106297905449.post-88806882640915420452017-11-30T00:40:00.000+09:002017-11-30T12:22:12.904+09:00Planck 키보드 + 엠스톤 블루치즈 DSA 키캡<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">엠스톤 블루치즈 DSA</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금은 판매하지 않는 엠스톤 블루치즈 DSA 키캡을 키보드랩에서 중고 거래로 구했습니다. 전에 KDB Fans에서 구입한 알록달록 DSA와 함께 사용할 생각으로 구매하였습니다. 무엇보다 KDB Fans나 알리익스프레스에서는 2U 크기 DSA 키캡을 따로 판매하지 않았기 때문이기도 합니다. Planck 키보드의 스페이스바 때문에라도 구매하고 싶었습니다.</span></div>
<b id="docs-internal-guid-34e4c24b-086d-fde0-8c1a-4bd531cac9e2" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/qeigKL1iZ1PtOzbMWGT-Dq_Y8VxJL9uLdQF0C07UnxXYYzaWhp4NudjCXKTH_nrAIvS2UZ6l7HahWG8g96p1YRuZ38sm3s0y6ANdGm5E0yjgvnUNrKQg1ujCTy71Fo0Us6bjaPL2" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡 살펴보기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">엠스톤 블루치즈 DSA 전에는 스페이스바 자리에 XDA 키캡이 있어서 많이 어색했습니다. DSA 키캡으로 교체하니 전체적으로 정갈한 느낌이 들어서 마음에 듭니다. 하지만 생각지도 못한 점을 발견하였습니다. 엠스톤 DSA와 KDB Fans에서 구입한 DSA가 키캡의 윗면 크기가 약간 달랐습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh4.googleusercontent.com/d8pf78-RXobqvMhWqKdSPJTrT_i8Mbe6J6mYSy5m9vt9fPoeUFc8yf1E60PEwO4naq5DX3AjTfGnKMUdvYqQC_m10Xhf6m0IvgPkpVyVO-QmHkwJ7F9AlRsJCG3Un7r5xRfnevoJ" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 사진에서 볼 수 있듯이 같은 DSA 키캡이지만 약간의 차이가 있습니다. 사진을 자세히 봐야하지만, 엠스톤 블루치즈 DSA의 윗면이 조금 커서 XDA 키캡과 살짝 비슷한 느낌이었습니다. KDB Fans에서 구입한 DSA의 윗면은 손가락 끝이 꽉 차는 느낌인 반면에, 엠스톤 블루치즈 DSA는 손가락 끝이 넉넉하게 닿는 느낌입니다. 엠스톤 블루치즈 DSA가 키캡을 누르기 편리하였습니다. 하지만 KDB Fans DSA는 조막조막(?) 자갈자갈(?)한 느낌이 있어서 나름 즐거웠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그리고 엠스톤 블루치즈 DSA는 다른 블로그 글에서도 언급한 것처럼 거친 느낌이 강합니다. 부드럽게 만져지는 것과는 확실히 거리가 있습니다. 반면에 KDB Fans의 DSA는 일반 PBT 재질 키캡 정도의 느낌을 줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh6.googleusercontent.com/9s97lX2v9Ii_J1xo1_83Zy3JpI7dFbpkA-V9nQol1cix_QwZghTqlUGNZZkFOCmBRvziFdW0cI3AKTmJE2Z2C_nvmG36mDhTbh33mCuyFHxEzZlHzsFj_uCO_eTMhGrFfbFk_JtV" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">또 다른 차이점은 키캡의 높이입니다. 엠스톤 블루치즈가 KDB Fans의 키캡에 비해서 미세하게 높습니다. DSA라고 완전히 동일하다고 생각하기는 힘듭니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/mCdL5rvePSdSHeUsA-Sly4UN0TWLDkDtIV_slEDP8LZUy63cJbWjn01_M0Owk6I08LhpMbxlzXSjclNs4AhfLSjt92IxyLFc6aZG8pNfYtcOBs1pXLzIoDszo8uLsXQ7bVLZWWag" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡의 뒷면은 엠스톤에서 밝혔듯이 1.3mm 정도됩니다. 얇지고 두껍지도 않는 느낌이었습니다. 키캡이 수축되어 우그러진 것도 심하지 않았습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">색상은 적당히 부드러운 치즈 색감을 잘 살렸습니다. 단일 키캡을 보는 것보다 키캡을 모두 장착한 키보드에서 느껴지는 색감이 훨씬 좋다는 느낌입니다. 개인적으로 마음에 듭니다. 블루 색상 키캡은 색상이 치즈 색상에 비해 많이 짙습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">마무리하며</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡을 모두 장착하고 나니 가지고 있는 오렌지 색상 케이스와 더 잘 어울릴 것 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/NW_13_3UP9CC6dlVzl3B9XL2-OwweOQUapDqI3sRhzboojIsagsioeCmJjoSaZKS8Erz9Eza5aIke3kCfpJrlGsmLouCvAfLocjwLWY17jxtjEd147ufu5Y5v9A7gbEgJ88SjUDJ" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/-AuOD-YFo4G3D5P7UBvREqZgHs3MCtpGhIyCjyBB4HGZ2jAiNp4U_-qOJ4flE-xVV--wSwxONEqsV9NfwUsGMnDg8zLg0gwrKLUvWP2CiSuFdazVm-uWe2qOlsE2LHfw5qVDG5Gb" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-1831119801561880702017-11-27T13:58:00.000+09:002017-11-30T12:21:57.742+09:00Planck 키보드 + DSA 키캡<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드 + DSA 키캡</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드를 사용한 이후로 낮은 키캡에 대한 관심이 많이 생겼습니다. 작은 키보드와 잘 어울리기도 하고, 키보드가 작기 때문에 체리, OEM, SA 프로파일처럼 키캡마다 경사도가 있지 않아도 크게 불편함을 못 느꼈기 때문입니다.</span></div>
<b id="docs-internal-guid-497e092b-fbd6-2551-86d5-96e7570f8a48" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="277" src="https://lh5.googleusercontent.com/XM4QwPlbsDW2gN2PBYYF9U4JKszeORNIwMO_-aamC0kLYvFuiwlOO1drMTcrgmv6TLzxoqSLZOC2MiSMGuqRiaMRoikzziRfF2MGqzCjfhsyXEilCRCR15q9kQBDcTLWqWf-WmnN" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">https://geekhack.org/index.php?topic=69133.0</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 사진에서 볼 수 있듯이 체리와 OEM 프로파일은 타자를 좀더 편하게 칠 수 있도록 키캡이 비스듬하게 기울어져 있는 것을 확인할 수 있습니다. 실제로 키캡의 경사가 손가락으로 키캡을 좀더 편하게 누르는데 도움을 줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 이런 편함을 잘 느끼지 못하거나, 다른 심미적인 이유로 이런 편함을 포기할 수 있는 사람도 있습니다. 바로 저 같은 사람입니다. 나의 아이템이 예쁘면 불편함은 느껴지지 않는다는 마음이죠. DSA 혹은 XDA 키캡은 체리나 OEM의 경사도를 완전하게 배제하였습니다. 모든 키캡이 평평하게 나열됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키보드 하우징 자체가 경사도가 전혀 없고, DSA 키캡을 사용한다면 정말 완전히 평평하게 배치된 키캡을 확인할 수 있을 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">아래 사진에 나오는 키캡은 타오바오와 알리익스프레스에서 쉽게 구매할 수 있는 DSA 키캡입니다. 저렴한 가격에 DSA를 맛보기에 좋습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡이 저렴하지만 생각보다 적당한 두께로 만들어져 있어서 조금 놀랐습니다. 키를 누르는 느낌이 제법 괜찮아서 가성비 측면에서 아주 만족하고 있습니다. 색상도 싸구려스럽지 않게 잘 나온 점도 마음에 듭니다. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저렴하고 사용성도 좋은만큼 당분간 회사에서 재밌게 사용하고 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/Zw7nFAxZ27cPvJLE31TruqF9Q06BwNy4RPHDEXFszEZo2F4zgxVba48ZP-c3Pkf4sDnKAjSOE_Jjwv91gOKhblsXbrxf3rz9gh6xciJfjSMlX0o2KS1PgWafLKC6mHpihI0hq_6D" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/-aKBYTUvDz94xW2FZs6prfKaNOhheVFQ9MOjHbkQlUlJ8dOn_jHFivpj9jYoLAv-wPur-p5a8-sIy3WZbiaA3EH-3AlvnE7wXYZ5EK8hk7c9fAKI6iTEnhwvTe6RMKAZlcwhjLdR" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-82192518364843779932017-11-24T00:12:00.000+09:002017-11-24T00:12:31.056+09:00Visual Studio Code + Java - VS Code에서 Java 사용하기<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code + Java</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code는 사용자의 필요에 맞게 편집 도구의 기능을 다양한 방식으로 확장시킬 수 있는 장점을 가진 편집기입니다. Visual Studio와 비교하면 매우 가볍게 사용할 수 있으며, 편집기 자체의 디자인과 사용성도 우수하다고 생각합니다. 최근에 간단한 Java 코드를 연습해볼 필요가 생겨서 VS Code의 확장 도구를 이용해보고자 하였습니다. 설정은 어렵지 않게 완료할 수 있습니다. Java를 처음 공부하시는 분들도 VS Code로 시작하는 새로운 도전을 해볼 것을 추천드립니다. VS Code에서 HTML, Java Script 등도 편집할 수 있기 때문에 익숙해지면 여러모로 편리할 것입니다. 그리고 이 튜토리얼은 Windows 10 환경을 바탕으로 작성되었습니다. 참고 자료는 </span><a href="https://code.visualstudio.com/docs/languages/java" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Java in VS Code</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code 설치</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가장 먼저 VS Code를 설치해야 합니다. 이곳에서 </span><a href="https://code.visualstudio.com/download" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">VS Code를 다운</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">받아서 설치할 수 있습니다. 설치 과정에서 주의할 점은 특별히 없습니다. 다만 자신의 필요에 따라 확장 도구를 추가로 설정하거나 편집기 설정을 수정하는 것이 편리하지는 않으므로 약간의 수고로움이 따릅니다. 세부 설정은 나중으로 미뤄두고 Java 확장 도구를 설치해야 합니다. 먼저 VS Code를 켭니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Java Extension Pack 설치</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code가 설치되었으므로 이제 Java를 위한 확장 도구를 설치하겠습니다.</span></div>
<b id="docs-internal-guid-ec85b990-e96f-2601-6e8c-245681308329" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="219" src="https://lh3.googleusercontent.com/EwSMFxywKLguGao6TJAg4M2glfmG79jItLS-NQ3imigsDpfibStqPCvJeIJuJ62waCkqVSKDzm8KUZ7WicqbLm5OFuEB4uiVVB6oq10XmBhR_F0F2YqE4kQb1-z7_n7qsADgx8XN" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code 켜지면, Extension View를 엽니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ctrl + Shift + X</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 눌러서 열 수 있습니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Extension View의 검색창에 ‘java extension pack’을 입력하면 결과를 나타납니다.</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="427" src="https://lh4.googleusercontent.com/Gb4ECiyn4WLi_vtzH9MR1ZzD9wKg6h9B5m2Izvt-OnA_B-vpZm-bRSzGxsNzJROE2XdgA1Z1nKfWlg2jVFn1V87_jGtvC3g3N90usCNeZE-YsgQRT7YV-wJK9lT6C3WMX5DA-1Rm" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol start="3" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">enable로 설정하면 Java Extension Pack이 설치되고, VS Code를 재시작합니다. 참고로 Java Extension Pack은 Language Support for Java™ by Red Hat과 Debugging for Java로 구성되어 있습니다.</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Java를 위한 확장 도구 설치는 완료되었습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">JDK 설치</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 JDK(Java Development Kit)을 설치하여야 합니다. JDK는 </span><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">여기</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서 다운받으면 됩니다. 참고로 저는 지금 jdk 1.8.0 버전을 사용하고 있고, VS Code에서 문제없이 사용하고 있습니다. 최신 버전도 문제없을 것으로 예상됩니다. 혹시 문제가 있다면 낮은 버전을 사용하길 바랍니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">환경변수 설정</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">JDK의 환경변수만 설정하면 이제 끝입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">JDK가 설치된 경로를 확인한 후, 경로를 복사해둡니다. JDK는 보통 ‘C:\Program Files\Java\jdk1.8.0_144’와 같은 경로에 설치됩니다.</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="353" src="https://lh3.googleusercontent.com/IywAc9-oKvZLPAugIO-tKkHgO-xqq2biFI6QVUqDOKTPvDozqLEtCa9EJ4COROvKlQ994KbVOueQRODurPheBtW1zym3xkshKA5hwNkuuLMVC-vemL6jesPiB7kdaVjcRDtRcwwi" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol start="2" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">제어판의 시스템에서 환경 변수 편집 창을 엽니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">시스템 변수에 JAVA_HOME, JDK_HOME 변수를 추가하고, 값은 복사해두었던 JDK 경로로 설정합니다. 두 변수 모두 같은 JDK 경로를 입력하면 됩니다.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="728" src="https://lh5.googleusercontent.com/PjPltAdv7LDfYPx1R6KT-4_LDKP-TJmOJEgz-sgVRbr0v2Ldpr5pXIzNxRxlpEpYy8FgZHAkO7F6xcUpS9aZIAfAJkbx4NU4oM61P1FK6_yczd4U2oGLXQuc7nX8HdU2RE7ngeYQ" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol start="4" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">추가로 VS Code의 workspace settings에서 java.home에도 JDK 경로를 입력하면 됩니다.(이 과정은 건너뛰어도 문제는 없습니다. 만약 이 과정은 건너뛰어서 에러가 발생하였다면 추가로 설정합니다. 주의할 점은 JDK 경로의 escape 문자를 ‘/’로 바꾸어야 합니다.)</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="105" src="https://lh3.googleusercontent.com/IgUaCyfC9xQpX_XcrMxS_bkNXghA0XFV9w9Sku4vIvqWwDpd3HATuPUb87gmZYnhrYQLiCb0dz2TWx6BJ-hr4D3yHl4QHm50ahCpdRN7xIJfSwRIb7kerazGhWVvj8aMMSlBRxs-" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="403" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">환경변수 설정도 모두 끝났습니다. 이제 hello world를 위한 시간이 찾아왔습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello World</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VS Code에서 폴더를 하나 생성한 후, HelloWorld.java 파일을 생성합니다. 그리고 Hello World를 출력하는 코드를 작성합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="236" src="https://lh5.googleusercontent.com/gycwji5IwlF5QcLxeHhu6biQkmR9kGU1NQapflAGUsnTlm0RYmu8K7Yff0FDB84LbgYyAxnKlDKJk6KKLCDpZz2q2h6ro9ZQg1pMeuVwpGcIrNY-H7ntAIAycTGpSLL45iNOKYan" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="405" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debug 메뉴에서 Start Without Debugging을 누르거나, Ctrl + F5를 누릅니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">결과는 Debug Console에서 확인할 수 있습니다. Debug Console이 보이지 않는다면 View 메뉴에서 Debug Console을 누르거나 Ctrl + Shift + Y를 입력합니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여기까지 오셨다면 VS Code로 기본적인 코드를 사용할 수 있는 기본적인 설정은 마무리되었습니다. 깔끔하고 가벼운 편집기인 VS Code에서 즐겁게 코딩하세요.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com8tag:blogger.com,1999:blog-8901079106297905449.post-54342235490495090862017-11-13T23:19:00.000+09:002017-11-13T23:19:12.593+09:00[Python] Flask - Form 데이터를 템플릿(template)으로 전달하기<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Request Object</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">클라이언트 웹 페이지의 데이터는 global request object를 통해서 서버로 전달됩니다. request 데이터를 처리하기 위해서는 Flask 모듈로부터 import되어야 합니다.</span></div>
<b id="docs-internal-guid-f24773e6-b5bd-1fab-7248-181de497a7ae" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">request 객체의 중요한 속성은 다음과 같습니다.</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - form 매개변수를 key로, 그 값을 value로 하는 쌍을 보관하는 dictionary입니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">args</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - URL 부분 중 물음표(?) 다음에 있는 query 문자열의 내용을 parse합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cookies</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Cookies 이름과 그 값을 가지는 dictionary 객체입니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">files</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - 업로드 파일과 관련된 데이터</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">method</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - 현재 request method</span></div>
</li>
</ul>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form 데이터를 template으로 전달하기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL 규칙에서 명시한 http method에 대해서 이미 살펴본 적이 있습니다. 발동된 함수에 의해서 전달받은 </span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 데이터는 dictionary 객체의 form에 수집할 수 있고, 그 데이터를 대응하는 웹 페이지를 보여줄 template으로 보낼 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 예에서 ‘/’ URL은 form을 가지고 있는 웹 페이지 student.html을 보여줍니다. form에 채워져있는 데이터는 result() 함수를 발동시키는 </span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">‘/result’</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> URL로 전달됩니다. </span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result() </span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">함수는 dictionary 객체에 있는 현재 </span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">request.form</span><span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 내의 form 데이터를 수집합니다. 그리고 result.html을 보여주기 위해서 그 데이터를 보냅니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">템플릿은 동적으로 form 데이터 테이블을 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Python 애플리케이션 코드는 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, render_template, request</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/')</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">student</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'student.html'</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/result',methods = ['POST', 'GET'])</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> request.method == </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'POST'</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> result = request.form</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"result.html"</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,result = result)</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 코드는 먼저 살펴보겠습니다. ‘/’ URL로 접속하면 웹 애플리케이션은 student.html을 브라우저에 보여줍니다. ‘/result’ URL로 접속하면 HTTP 메소드에 따라서 다르게 처리됩니다. 이번에는 POST 메소드만 사용할 것입니다. POST 메소드로 요청이 들어온다면 result.html을 브라우저로 보여줍니다. ‘result’ dictionary도 함께 인자로 전달합니다. 이 dictionary는 어떻게 구성되었는지는 student.html을 보면 알 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> action = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"http://localhost:5000/result"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> method = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"POST"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Name </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Name"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Physics </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Physics"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Chemistry </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"chemistry"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Maths </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type =</span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Mathematics"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">><</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"submit"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> value = </span><span style="background-color: #333333; color: #a2fca2; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"submit"</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 스크립트는 form을 다루고 있습니다. HTTP POST 메소드를 사용하고 있고, 이 폼을 전달하면 http://localhost:5000/result로 이동할 것입니다. form 데이터는 Name, Physics, Chemistry, Maths를 전달합니다. form 데이터를 제출할 ‘submit’도 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그러면 http://localhost:5000/result로 이동하면 어떤 일이 생길까요? 다시 웹 에플리케이션 코드를 살펴보면 됩니다. ‘/result’ URL을 HTTP POST 메소드로 접근하면 result.html을 보여주도록 되어 있습니다. 그리고 form 데이터를 result 인자로 전달합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 result.html 스크립트를 살펴볼 차례입니다. 이 스크립트는 웹 애플리케이션에 의해서 ‘result’ form 데이터를 전달받습니다. 그리고 이 dictionary 데이터를 순회하면서 key, value를 테이블로 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><!doctype html></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><html></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <body></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <table border = </span><span style="background-color: #333333; color: #d36363; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> key, value </span><span style="background-color: #333333; color: #fcc28c; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> result.iteritems() %}</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <tr></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <th> {{ key }} </th></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <td> {{ value }} </td></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </tr></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% endfor %}</span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </table></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </body></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></html></span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 웹 애플리케이션을 실행해봅시다. 먼저 http://localhost:5000/로 접속합니다. 그러면 student.html 스크립트를 브라우저에서 보여줄 것입니다. 결과는 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="196" src="https://lh4.googleusercontent.com/ouy-8PP9NBY7f2YOyuThC6sYe2rfnWf-LFK1OBTVazK_1sOPG0eLzc8YejAGaAaKAhFdUtxDp97ShUnjQrw7Tv0VYbidaMx09i55ssYjpG_JC7vBLkWg00MEXS5RNl8bhrtWhJxl" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="275" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form 데이터 항목을 보여주고, 제출할 수 있는 input도 생성되어 있습니다. 원하는 텍스트로 각 항목을 채우고 submit을 누릅니다. 그러면 form action으로 지정되어 있는 </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/result로 이동합니다. Flask 웹 애플리케이션 코드에서 ‘/result’는 라우팅되어 result.html 스크립트를 브라우저에 보여줍니다. form 데이터는 ‘result’ dictionary로 result.html에게 전달되고, 우리가 채운 항목들이 테이블 형태로 보여지게 됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="122" src="https://lh4.googleusercontent.com/atOcCu79XagMvcPg9-fHKSML4rADJRH2tQJH7rPD5H5XoOGrP1lZtisDolfoQnewdmhF0SLKbWL9UgZ9IvDsECQWqKR1mL2wGO2tcjB058_Y3S00JSuJL-Bk55Lfy5msujII9yZV" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="200" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이렇게 우리는 form 데이터를 HTTP POST 메소드로 전달하여 우리가 만든 result.html 템플릿에 적용하여 브라우저에서 확인하였습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">클라이언트에 정보를 저장할 수 있는 쿠키(cookie)에 대해서 알아보겠습니다.</span></div>
<div>
<span style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-85979551892566292562017-11-12T23:20:00.000+09:002017-11-13T23:20:16.805+09:00[Python] Flask - 정적 파일(Static Files)<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask Static Files</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 애플리케이션은 종종 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">javascript</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 파일 혹은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CSS</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 파일과 같이 웹 페이지를 보여주는데 도움을 주는 정적(static) 파일이 필요합니다. 보통 웹 서버는 정적 파일을 사용할 수 있게 설정되어 있지만, 개발 과정 중에는 정적 파일은 package 내 혹은 모듈 옆의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 폴더에서 제공됩니다. 혹은 정적 파일은 애플리케이션의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/static</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서 사용할 수 있습니다.</span></div>
<b id="docs-internal-guid-f24773e6-b097-ee6c-1089-42d4d33d3e9a" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">특별한 종단점(endpoint)인 ‘static’은 static 파일의 URL을 생성하는데 사용됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">아래의 예시 코드를 살펴보겠습니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.js</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에 정의되어 있는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">javascript</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수가 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">index.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 내의 HTML 버튼의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OnClick</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 이벤트에서 호출되고 있습니다. index.html은 Flask 애플리케이션의 ‘/’ URL을 나타나는 스크립트입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 Flask 웹 애플리케이션 코드입니다. ‘/’ URL에서 index.html 스크립트를 보여줄 것입니다. 특별한 내용은 없습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, render_template</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route("/")</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">index</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"index.html"</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음은 index.html 코드입니다. head에서 url_for() api를 사용하여 ‘static’ 폴더 내의 ‘hello.js’ 스크립트를 읽어옵니다. body에서 button을 하나 생성하고, 클릭이 발생하면 sayHello() 함수를 호출할 것입니다. button에는 “Say Hello”가 써있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">head</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">script</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text/javascript"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> src = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"{{ url_for('static', filename = 'hello.js') }}"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">script</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">head</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"button"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> onclick = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"sayHello()"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> value = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Say Hello"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음은 sayHello() 함수를 포함하고 있는 hello.js 코드입니다. 앞에서 설명한대로 button을 누르면 이 javascript의 sayHello()가 호출됩니다. 기능은 단순하게 경보용 창을 뛰워서 “Hello Wolrd”를 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">function</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sayHello</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> alert(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Hello World"</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 Flask 웹 애플리케이션 코드를 실행하고, URL </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 입력합니다. 그러면 index.html 스크립트가 브라우저에 표시됩니다. index.html에서 버튼을 생성하였고, 버튼에는 “Say Hello”라는 문구가 들어가 있습니다. 다음과 같은 창을 볼 수 있을 것입니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="37" src="https://lh6.googleusercontent.com/74eD87F915pBcVkH9g5xbPidg0cqbxoSHTHAUuEG2cJUa-T2EllQDdYXnddCU2-vKMsK1Y8N8H9JUO-iy0FdRO1Owxwd74Rqm0BGp0ZfY0aXSqytsaEjHt-F9gLWy6tjqs7CEf2o" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="89" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그리고 이 버튼을 누르면 onClick 이벤트로 등록해둔 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sayHello()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수가 호출됩니다. sayHello() 함수는 head 태그 안에서 참조하는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.js</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 파일에서 가져옵니다. hello.js 파일 내의 sayHello() 함수의 기능은 단순합니다. Hello World가 표시된 경고창을 보여주는 것이 전부입니다. 결과는 다음과 같을 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="130" src="https://lh5.googleusercontent.com/29epJqvAff7chYSNPCM-lbeW0_G-yGrKmVHMgj0K19aL_YoitLy47RbSoGNcKFEQpToITj5FIAYgfj8ZPB4cR33da9NlCnoNqXF5uKax0AIhMJzpKBoZOU3mtYzr1EZRcwHn7YQj" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="444" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 기능을 담당하는 hello.js 파일은 static 폴더에 저장되어 있고, Flask의 url_for() 함수로 파일의 경로를 지정해주었습니다. 결과적으로 웹 애플리케이션이 실행되고 index.html 스크립트가 실행될 때 hello.js 파일을 /static/hello.js 파일을 찾아서 sayHello() 함수가 실행됩니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<span id="docs-internal-guid-f24773e6-b58f-9631-2e44-132358f23a06"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Flask의 request 기능을 살펴볼 것입니다. 그리고 <a href="https://mooneegee.blogspot.com/2017/11/python-flask-form-template.html">form 데이터를 웹 애플리케이션으로 전달하여 브라우저를 통해서 확인</a>하도록 할 것입니다.</span></span>Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-84609957260701614512017-11-06T21:00:00.001+09:002017-12-11T14:04:25.220+09:00[판매 완료] OLKB + Massdrop Planck 키보드 kit 판매합니다.<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드 kit 판매</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">massdrop을 통해서 올해 구입한 Planck 키보드 kit 판매합니다. 저는 매우 만족스럽게 잘 사용하고 있는 키보드입니다. 저는 이 키보드를 이미 3개를 가지고 있어서 더 조립하는 것보다는 판매하는 것이 좋겠다고 생각했습니다. 사실 제가 배송받은 것 중 하나가 약간 문제가 있어서 massdrop에 부분 환불을 요청하였는데, massdrop 측에서 새로운 kit을 하나 보내주었습니다. massdrop 구매 내역이 좀 많아서 그렇게 해준 것 같습니다. 제품 수령까지 매우 긴 시간이 걸리기로 악명 높은 massdrop이지만 고객 대응은 참 잘합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">제품 설명</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">판매하는 제품은 완성된 키보드가 아니라 직접 조립해야 합니다. PCB에 키 스위치를 납땜해야 합니다. 키보드를 DIY해본 경험이 없으신 분은 추천드리지 않습니다. 납땜 도구를 따로 구해야 하기 때문입니다. 자세한 구성품을 확인하고 싶으신 분은 </span><a href="https://www.massdrop.com/buy/28284" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">여기</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 참고하시면 됩니다. 구매 내역은 다음과 같습니다. 배송비 포함 144달러에 구매하였습니다.</span></div>
<b id="docs-internal-guid-7f886ba6-912a-f815-2ffa-abe60dff6641" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="207" src="https://lh5.googleusercontent.com/LjzKDV_F79F4Cvwen80vPwJxEeWsfNlZyARsfmWEhdw2vCt_sI8fDqzmMDUtCaXSn-X3YPRXM6JMosGuD5MA47M0X0y5ACxj3pI3dg_wR7zZ1pri9tYL83IUE9gH7LJTyzyvzFKj" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">제품 구성품은 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh4.googleusercontent.com/-kbTtY5VPY_eTuZTj7ILSiWoMkwKzkGzy-XnFr9w-RZfbiVqLQ4UksVKR89h_Anh_YHP-Yw1PgGx4TjVYEJ0c29Uf_-QGSik9_34ERxc2E_9CNUFiBQ-0IgJSe4mvozSD24N6e9F" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">플레이트(Plate)</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2016년도 제품보다 많이 개선되었습니다. 스위치가 바르지 못하게 삐뚤하게 꽂혔던 문제가 해결되었습니다. 그리고 납땜이 된 상태에서도 스위치 상부 하우징을 쉽게 분리할 수 있게 홈이 있습니다. 키 스위치를 커스터마이징을 자주 하는 분에게 상당히 마음에 드는 부분일 것입니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">알루미늄 케이스</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">매우 매끈하게 가공되어서 완성도가 높습니다. 색상은 건메탈입니다. 아래 사진은 제가 사용하고 있는 건메탈 색상의 Planck 키보드입니다. 판매하는 kit와 동일하므로 참고하시면 됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/ymCYagfkcRXlfDHd450m7-hD0-Uwg19DoL9ApG4-rXz9iG9EAN8C5ozWZ0en1_tLNk_CA2Q8fXZb0NkQJ9MGEFOr8_a49fiNLQ1jVZP2gCgy_qfRGgdNjOnghrOYQPmBV-oubG2b" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">PCB</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4번째 버전 제품입니다. 최신 qmk 펌웨어를 지원하고 있습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">흡음 패드</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">PCB와 케이스 사이에 넣을 흡음 패드도 포함되어 있습니다. 케이스 크기에 잘 맞습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USB 케이블</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">흰 색 USB 케이블입니다. 특별한 점은 없지만 일반 케이블보다는 품질이 좋습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></h2>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">보관 가방</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드 전용 가방입니다. 의외로 쿠션도 잘 되어 있고, 내부가 매우 부드러운 재질로 되어 있기 때문에 케이스가 긁힐 일이 없습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키 스위치</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">체리 청축(MX blue)입니다. Planck 키보드에 필요한 숫자만큼 포장되어 있습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">포함되어 있지 않습니다.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 저는 이전에 사용하던 다른 키캡을 사용해서 주문하지 않았습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">구매를 원하시는 분들에게</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">중고나라에 작성할까 했는데, 제 블로그에 종종 Planck 키보드를 구경하러 오시는 분이 있어서 블로그에 판매글을 올립니다. 이 키보드에 대한 더 자세한 내용은 제 블로그에서 검색하여 찾아보시면 구매를 결정하는데 많은 도움이 될 것입니다. 매우 좋은 제품이지만 호기심으로 사기에는 위험 부담도 있는 제품인 것도 사실입니다. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가격은 12만원입니다. 판매 관련 문의는 댓글이나 </span><a href="mailto:mooneegee@gmail.com" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">mooneegee@gmail.com</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">으로 연락주시길 바랍니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">혹시 이 제품에 대한 궁금한 점도 상세하게 답해드리도록 하겠습니다. 특히 펌웨어로 레이아웃을 커스터마이징하는 것이 어려운 분들도 댓글 남겨주시면 확인하는데로 답해드리겠습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="font-family: "consolas";"><span style="font-size: 14.6667px; white-space: pre-wrap;">그나저나 블로그에 판매글 올리면 얼마나 오랫동안 판매가 안될지 조금 걱정이기도 하네요.</span></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com2tag:blogger.com,1999:blog-8901079106297905449.post-27060274297547026082017-10-31T20:57:00.000+09:002017-11-12T23:21:08.390+09:00[Python] Flask - Template과 웹 템플릿 시스템(Web Template System)<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask - Templates</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">함수의 결과물로 HTML의 form에 특정 URL을 반환할 수 있습니다. 예를 들어, 다음 스크립트에서 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수는 ‘</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello World</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">’를 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;h1&gt;</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 태그를 붙여서 반환합니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b id="docs-internal-guid-5884e4b4-7249-950a-32df-4f3891c33c19" style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask import Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">index</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> return '&lt;html&gt;&lt;body&gt;&lt;h1&gt;Hello World'&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = True)</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 HTML 컨텐츠를 Python 코드로 생성하는 것은 쉽지 않습니다. 특히 변수 데이터와 조건문, 반복문과 같은 Python 언어 요소를 넣을 필요가 있다면 더욱 그러합니다. 그리고 HTML에서는 빈번한 escaping이 필요하게 될 것입니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이런 불편함을 극복할 수 있도록 Flask는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Jinja2</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 템플릿 엔진을 기본으로 사용합니다. 함수에서 하드코드 HTML을 반환하는 대신에, </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">render_template()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수를 사용해서 HTML 파일을 랜더링할 수 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask import Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">index</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> return </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">render_template</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello.html'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = True)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 코드를 실행시키면 Flask는 templates 폴더에서 ‘hello.html’ 파일을 찾을 것입니다. templates 폴더는 지금 우리가 작성하는 스크립트와 동일한 위치에 있습니다. 다음은 Flask에서 사용하는 폴더 구조를 나타내고 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Application folder</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello.py</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">templates</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.html</span></div>
</li>
</ul>
</ul>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 템플릿 시스템(web template system)</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">은 동적으로 변수 데이터를 삽입할 수 있는 HTML 스크립트의 디자인을 참조합니다. 웹 템플릿 시스템은 템플릿 엔진, 데이터 원본, 템플릿 프로세서로 구성됩니다. 위키피디아에서 </span><a href="https://en.wikipedia.org/wiki/Web_template_system" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">web template system</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 검색하면 자세한 설명을 확인할 수 있습니다.</span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img alt="330px-TempEngWeb016.svg.png" height="624" src="https://lh3.googleusercontent.com/VO7ixUT3QDLXdIfNeqoekO_eoZsLMHvdA3FKvYhDSdKs_AyuKINA4ZbQBNHlDU8MKFpttY3eYRCyC4kD3aXVCSFMcd5h5jW2hnjuKID0EvhTfnXFUg8_I3WldmOoVbw-xzK5opaW" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="330" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://en.wikipedia.org/wiki/Web_template_system" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://en.wikipedia.org/wiki/Web_template_system</span></a></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 그림은 web template system에 대해서 간략하게 표현하고 있습니다. 데이터베이스에 있는 데이터 원본이 바로 우리가 보여주고 싶은 자료입니다. 이 데이터 원본을 좀더 효과적으로 전달하기 위해서 우리는 미리 만들어 둔 HTML 스크립트를 사용할 것입니다. 미리 준비해둔 HTML 스크립트에 지정되어 있는 변수에 데이터베이스에서 가져온 데이터를 집어넣어서 보여주면 사용자가 보기 좋은 형태로 구성된 웹 페이지를 볼 수 있게 됩니다. 미리 준비해둔 HTML 스크립트가 바로 웹 템플릿입니다. 데이터 원본을 웹 템플릿과 동적으로 연결하는 작업은 템플릿 엔진이 담당합니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">jinja2</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 템플릿 엔진을 사용합니다. 웹 템플릿은 변수와 표현식(이 경우에는 Python 표현식)의 placeholder가 배치된 HTML 문법을 포함하고 있습니다. 템플릿은 랜더링될 때, 데이터 원본에서 가져온 값으로 교체됩니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 코드를 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이라는 이름으로 templates 폴더에 저장합니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;!doctype html&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello {{ name }}!</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그 다음 스크립트를 실행합니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, render_template</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/hello/&lt;user&gt;')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_name</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(user):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello.html'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, name = user)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개발 서버가 동작하기 시작하고 나서, 브라우저를 열고 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello/myName </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL을 입력합니다.</span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL이 입력되면 파이썬 코드는 URL을 라우팅합니다. myName은 user 인자의 매개변수로 전달됩니다. 그리고 render_template() 함수가 hello.html 스크립트를 랜더링할 때, name 인자의 매개변수로 myName을 전달합니다. hello.html 스크립트의 {{ name }} placeholder는 myName으로 대체되어 웹 브라우저에 랜더링됩니다. ‘Hello myName!’을 확인할 수 있을 것입니다.</span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">jinja2</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 템플릿 엔진은 HTML에서 escaping하기 위해서 다음과 같은 구분 문자(여기에서는 hello.html 스크립트의 {}처럼 보통의 html 스크립트가 아니라 jinja2에서 관리하기 위해 사용하는 문자)를 사용합니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{% … %} 선언하기 위해서 사용</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{{ … }} template output을 출력하기 위한 표현</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{# … #} template output에 포함되지 않는 주석</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># … # 줄 단위로 선언하기 위해서 사용</span></div>
</li>
</ul>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 코드는 template에서 조건문 선언을 보여줍니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_score()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수의 URL rule은 정수 매개변수를 받습니다. 전달받은 정수 인자는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> template로 다시 전달됩니다. ‘marks’라는 변수로 전달받은 숫자값은 조건문에서 지정한대로 비교됩니다. 50보다 큰지 작은지 확인한 후, HTML 스크립트가 조건적으로 표시됩니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; white-space: pre-wrap;">Python 코드는 다음과 같습니다.</span><br />
<span style="font-family: "consolas"; font-size: 11pt; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, render_template</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/hello/&lt;int:score&gt;')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_score</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(score):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello.html'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, marks = score)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> template 스크립트는 다음과 같습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;!doctype html&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% if marks &gt; 50 %}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Your result is pass!</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% else %}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Your result is fail</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% endif %}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">조건문 선언인 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if-else</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">endif</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{% … %}</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">로 감싸져있는 것을 확인하길 바랍니다.</span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 Python 스크립트를 실행하고 URL </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello/70</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 방문합니다. 그리고 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello/30</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">도 한번 방문해보도록 합니다. 웹 브라우저에서 html 스크립트가 조건에 따라서 다르게 결과를 보여주는 것을 확인할 수 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">조건문뿐만 아니라 Python 반복문도 template 안에 넣을 수 있습니다. 다음 스크립트는 URL </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/result</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가 브라우저에서 열리면, </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수는 Python dictionary 객체를 result.html template로 전달합니다.</span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">은 Python dictionary 객체의 key와 value를 HTML 테이블의 셀로 화면에 표시하기 위해서 반복문을 사용하고 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Python 코드는 다음과 같습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, render_template</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/result')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> dict = {</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'phy'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">50</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'che'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">60</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'maths'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">70</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> render_template(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'result.html'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, result = dict)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">templates 폴더에 들어갈 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">result.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 스크립트는 다음과 같습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;!doctype html&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">table</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> border = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% for key, value in result.iteritems() %}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tr</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">th</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {{ key }} </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">th</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">td</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {{ value }} </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">td</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tr</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {% endfor %}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">table</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;/</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&gt;</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">늘 했던대로 Flask 웹 애플리케이션을 실행하고, 웹 브라우저에 URL </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/result</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 입력합니다. 결과는 다음과 같을 것입니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="84" src="https://lh6.googleusercontent.com/cJalWFf7T6En-kSpORE3LMKbCm9b2jqOdhOvdjYho6pQwRHA5AcFEuTil8Fm1Ve4vLHbdu0co0r_PVAfY6PKxILEpC2AXyTpnKApV39VHlxORpPi-feLvnmySZg-_mWdHpZw_aL-" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="80" /></span></div>
<b style="font-weight: normal;">
</b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 애플리케이션은 URL ‘/result’을 라우팅하여, 연결된 result() 함수를 실행합니다. result() 함수는 Python dictionary 객체를 생성하고, result.html 스크립트로 이 객체를 result 변수로 전달합니다. result.html 스크립트는 전달된 Python Dictionary 객체인 result의 key, value 값을 웹 브라우저에 표시합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음의 다룰 내용을 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/11/python-flask-static-files.html">웹 애플리케이션에서 사용하는 javascript나 CSS 파일을 사용해볼 것</a>입니다. 이와 관련하여 static 폴더에 대해서도 알아볼 것입니다.</span></div>
<div>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">
</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-55927454656369599352017-10-24T00:08:00.000+09:002017-10-31T20:58:24.149+09:00[Python] Flask - HTTP 메소드(GET, POST)<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask - HTTP 메소드</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Http 프로토콜은 WWW(world wide web)에서 데이터 통신을 하는 근간입니다. 명시된 URL로부터 데이터를 탐색하는 다른 메소드가 이 프로토콜에 정의되어 있습니다.</span></div>
<b id="docs-internal-guid-a3f3531d-49c6-034b-2340-bc8e02a05151" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 표는 각각 다른 http 메소드를 요약한 것입니다.</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="82"></col><col width="542"></col></colgroup><tbody>
<tr style="height: 27pt;"><td style="background-color: #eeeeee; border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #313131; font-family: "verdana"; font-size: 10.5pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Sr.No</span></div>
</td><td style="background-color: #eeeeee; border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #313131; font-family: "verdana"; font-size: 10.5pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Methods & Description</span></div>
</td></tr>
<tr style="height: 71pt;"><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span></div>
</td><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GET</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">암호화되지 않은 form의 데이터를 서버로 전송합니다.</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가장 흔하게 사용되는 메소드입니다.</span></div>
</td></tr>
<tr style="height: 71pt;"><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span></div>
</td><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">HEAD</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">response body를 제외하고 GET과 동일합니다.</span></div>
</td></tr>
<tr style="height: 89pt;"><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span></div>
</td><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">POST</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">HTML form 데이터를 서버로 전송합니다. POST 메소드로 전달받은 데이터는 서버에 cache되지 않습니다.</span></div>
</td></tr>
<tr style="height: 89pt;"><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span></div>
</td><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">PUT</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">현재 표현되고 있는 대상 resource를 업로드된 컨텐츠로 교체합니다.</span></div>
</td></tr>
<tr style="height: 71pt;"><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span></div>
</td><td style="border-bottom: solid #dddddd 0.75pt; border-left: solid #dddddd 0.75pt; border-right: solid #dddddd 0.75pt; border-top: solid #dddddd 0.75pt; padding: 6pt 6pt 6pt 6pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DELETE</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL가 준 현재 표현되고 있는 대상 resource를 제거합니다.</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">기본값으로 Flask 라우팅은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GET </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">request에 응답합니다. 하지만 이 설정은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">route() </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">데코레이터(decorator)의 메소드로 변경할 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL 라우팅에서 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">POST</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메소드를 설명하기 위해서 먼저 HTML form을 만들어야 합니다. 그리고 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">POST</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메소드를 사용해서 데이터를 URL로 전송해야 합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 스크립트는 login.html입니다. 이 스크립트는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">templates</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">폴더 넣으면 됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> action = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"http://localhost:5000/login"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> method = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"post"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Enter Name:</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"text"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"myName"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">><</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">input</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> type = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"submit"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> value = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"submit"</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">body</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">html</span><span style="background-color: #333333; color: #62c8f3; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">></span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 python 코드를 저장하고 실행합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, redirect, url_for, request</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.route(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/success/<name>'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def success(name):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'welcome %s'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> % name</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.route(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/login'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, methods = [</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'POST'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'GET'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def login():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> request.method == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'POST'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> user = request.form[</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'myName'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> redirect(url_for(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'success'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, name = user))</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> user = request.args.</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">get</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'myName'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> redirect(url_for(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'success'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, name = user))</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = True)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개발 서버를 실행한 후에, login.html을 브라우저에 엽니다.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> text field에 name을 입력하고 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Submit</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 누릅니다. login.html 파일을 인터넷 브라우저에 드래그 앤 드랍하면 다음과 같은 결과를 확인할 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="341" src="https://lh3.googleusercontent.com/ew536d5zr489IBE01cbMRCeQ8-6Nbh4aRzoTyGWMLheMTfu3Z-DrJGfu9STTojypyYkOYhTH0kskjrKG0DaHKm6n9q-xXdwZpexaH7oyKrlQSlEi2R3272wGlPHALOu1CoRY8ODC" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="600" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">login.html 스크립트의 내용은 간단합니다. form 태그 내부에 text input과 submit input이 있습니다. text의 input는 name으로 myName을 가집니다. Flask의 웹 애플리케이션에서는 request.form[‘myName’]으로 접근하게 됩니다. submit의 input은 value로 submit을 가집니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form 데이터는 form 태그의 action에 지정된 URL로 POST됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 Flask 웹 애플리케이션 코드를 보겠습니다. </span><a href="http://localhost/login%EC%9D%80" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://localhost/login은</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> login() 함수에 맵핑되어 있습니다. 서버는 POST 메소드로 데이터를 전달받습니다. form 데이터에서 얻은 ‘myName’ 매개변수의 값은 다음에서 얻을 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">user </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> request</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">form</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">['</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">myName</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">']</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">url_for() API를 사용해서 동적으로 url을 생성하고, redirect합니다.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ‘/success’</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> URL에 변수 부분(<name>)으로 전달됩니다. 브라우저는 전달받은 변수 부분을 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">welcome</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메세지를 창에 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이번에는 HTTP 프로토콜의 GET을 사용해보겠습니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">login.html</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">의 매개변수를 ‘</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GET</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">’으로 변경하고 브라우저에서 다시 열어봅니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GET</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메소드에 의해서 서버로 데이터가 전달됩니다. ‘myName’ 매개변수의 값은 이제 다음에서 얻어집니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">user = request.args.get(‘myName’)</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">args</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">는 form 매개변수와 그에 상응하는 값의 쌍을 포함하는 dictionary 객체입니다. POST로 전달한 데이터가 아니므로 args로 접근해야 합니다. ‘myName’ 매개변수에 상응하는 값은 앞에서 처럼 ‘/success’ URL로 전달됩니다. 결과는 앞과 당연히 동일합니다. 이 부분은 반드시 이해하지 않아도 무방하므로 참고 정도로만 생각하시길 바랍니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/python-flask-template-web-template.html">웹 템플릿 시스템(Web Template System)</a>을 다룰 예정입니다. 웹 애플리케이션 프레임워크가 동작하는 중요한 방법이므로 좀더 자세하게 다룰 예정입니다. </span></div>
<div>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-44869578943980444302017-10-21T03:58:00.000+09:002018-01-06T23:45:10.684+09:00[IT 제품 구매가이드] 기계식 키보드 - 스위치 스프링<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">들어가며</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX 계열 스위치의 스프링은 스위치에 반발력을 결정하는 중요한 부품입니다. 물론 기계식 키보드를 처음 입문하는 사람은 스프링을 크게 관심을 가지지 않습니다. 처음 기계식 키보드를 구매하는 사람은 대게 Cherry MX 스위치 혹은 Gateron, Kailh, Outemu 등에서 만든 스위치 중 적축, 청축, 갈축에 대해서 찾아봅니다. 각 축의 특색이 과연 나와 어울릴지를 고민합니다. 결국, 결정하고 키보드를 즐겁게 사용합니다. 사용하다보면 이런 생각을 하는 사람도 나타납니다.</span></div>
<b id="docs-internal-guid-ea3bbe5f-3b22-63f2-700f-e42666250caa" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">‘아, 키가 조금만 더 묵직했으면 좋겠다.’</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">‘아, 키가 살짝 가벼워서 경쾌하면 좋겠다.’</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">처음 선택하는 키보드는 대부분 쉽게 눌리는 스위치를 채택하고 있습니다. 스프링의 반발력이 크면 금새 피로가 느껴집니다. 특히 장시간 키보드를 이용해야 하는 사람은 곤혹스럽습니다. 그렇기 때문에 대부분의 키보드 제조사는 가볍게 눌리는 스위치로 채택합니다. 적축, 갈축은 손꼽히는 가벼운 스위치에 속합니다. 청축은 중간 정도의 힘이 드는 스위치에 속합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 앞에서 언급하였듯이 여기에 만족하지 못한 사람들이 있습니다. 이 사람들은 가장 먼저 다른 축은 무엇이 있는지 알아봅니다. 운 좋게 새롭게 선택한 축이 마음에 든다면 다행이지만 그것으로도 만족하지 못하는 사람들은 결국 스프링의 세계에 발을 내딛게 됩니다. 이 글은 기계식 스위치의 스프링에 대해서 다루도록 하겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">기계식 스위치의 부품</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="356" src="https://lh4.googleusercontent.com/BlBzKndzxGxxfs_5gCV_vIHQLrjuX3gC_D-dDbR-BO5XF7tbXex1LOYlNakYQhZ-dLHGr8Lqt3wYyfjMU3Sn5HRhBogOCHKSvhyeeWJqHbsLqtogN_vVjLGGBt_MtMtzQPjEbbVd" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="http://wiki.geekhack.org/index.php?title=Cherry_MX" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://wiki.geekhack.org/index.php?title=Cherry_MX</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Cherry MX 계열 스위치는 다음과 같은 부품으로 구성됩니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">상부 하우징</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하부 하우징</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치 축(스템)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스프링</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">상부 하우징과 하부 하우징은 모든 스위치에 공통으로 사용되는 부품입니다. 스위치 간의 차이는 축과 스프링에서 나옵니다. 위의 이미지에서도 볼 수 있듯이 스위치는 매우 다양합니다. 그리고 자세히 살펴보면 알 수 있듯이 조금씩 다른 스프링이 함께 있다는 것을 알 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치의 축은 키 스위치를 누르는 손끝에 전달되는 느낌을 결정합니다. 적축은 스위치가 매끈하게 눌러집니다. 청축은 딸깍 소리가 날 정도로 축이 걸려있다가 넘어가면서 소리를 냅니다. 갈축은 부드럽게 턱을 넘는 느낌이 납니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치의 스프링은 키 스위치의 반발력을 결정합니다. 스프링의 반발력이 약하면 우리는 손쉽게 스위치를 누를 수 있습니다. 반대로 강하면 더 많은 힘으로 스위치를 눌러야 합니다. 그래서 반발력이 약한 스프링은 경쾌한 느낌이 나고, 반발력인 강한 스프링은 묵직한 느낌이 납니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">적축과 흑축의 차이는 스프링이다</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh3.googleusercontent.com/_PDxVDbyGqv0Ep90gDzzsGQkjuUXKbvDQL3gDHUy_FEYdG_4x6m2aXbAICe2y8ONwkSoAbWTmlwL6ZON13r4D8RK3aRQH7_6ZXT8sfKGZu_eJvOAMxEvuROOqRE7_dgJI24WDhbb" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="http://wiki.geekhack.org/index.php?title=Cherry_MX" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://wiki.geekhack.org/index.php?title=Cherry_MX</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">적축과 흑축이라는 스위치의 이름만 본다면 뭔가 완전히 다른 것처럼 느껴질 수 있습니다. 적축과 청축은 정말 큰 차이를 난다는 것은 대부분 기계식 키보드 사용자들이 알고 있기 때문입니다. 사실 적축과 흑축은 두 가지 차이점이 있습니다. 하나는 축의 색깔이 다르다는 것이고, 또 다른 하나는 스프링이 다르다는 것입니다. 다시 말해서 축의 모양은 완전히 동일합니다. 스위치의 하우징을 열지 않더라도 스위치를 구분할 수 있게 축의 색을 다르게 만든 것입니다. 만약 그렇지 않았다면 눌러 봐야지만 그 차이를 구분할 수 있기 때문입니다. 이렇게 스프링은 스위치를 구분할 정도로 중요한 요소입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">참고로 갈축과 Clear축은 축 모양 자체가 조금 다릅니다. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="417" src="https://lh5.googleusercontent.com/Oo5wISs1enEUTnkb_dwvI7d4uIUqxIF70k0_YHF0L4VKvh9_FE0k1yrTtDUnP1zVCP3lro2Kg0kpE6nDU1XSaSXyMsX7gElNzbry3-mrWxQJw2Ai654NZIArAzYiVUg8XIhKDOtC" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://imgur.com/a/RJqM4" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://imgur.com/a/RJqM4</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">각 스위치 별로 축의 모양과 스프링이 어떻게 다른지 자세하게 확인하고 싶다면 </span><a href="https://imgur.com/a/RJqM4" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">여기</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">로 가보시길 바랍니다. 각 스위치의 부품을 클로즈업 한 사진이 매우 많습니다. 대부분의 외형 차이는 쉽게 확인할 수 있을 것입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스프링의 반발력? 무게? 힘?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 스프링의 핵심적인 기능인 반발력에 대해서 알아보겠습니다. 어떤 이들은 스위치가 버티는 무게라고도 말합니다. 외국 커뮤니티에서는 spring force로 표현합니다. 저는 반발력이라고 표현하도록 하겠습니다. 앞에서도 말했듯이 스프링의 반발력에 따라 스위치가 얼마나 경쾌한지 쫀득한지가 결정됩니다. 하지만 반발력이 지나치게 약하면 밋밋한 느낌이 들고, 지나치게 강하면 뻑뻑한 느낌이 듭니다. 그래서 자신에게 가장 적당한 경쾌함이나 쫀득함, 묵직함을 찾으려면 각 스프링의 반발력을 구체적으로 알아야 합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">참고자료는 </span><a href="https://input.club/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">InputClub</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서 가져왔습니다. 이 사이트는 K-Type 키보드, WhiteFox, Infinity ErgoDox와 같은 키보드를 디자인하고 판매하고 있습니다. 그리고 Massdrop과 분쟁으로 판매가 중지되어 있는 Input Club Halo True, Input Club Halo Clear와 같은 독특한 스위치를 만들기도 하였습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="416" src="https://lh4.googleusercontent.com/5CwbI1G7j6MlTJ2mgel7g0SGqleuLDbUxhYGhUQ4rnBgq5sJhaWBMcevOb4P1NnEprDnZ6YBEUBP_17YbCuGA9IQfi4j7feYMB6gRX_vhKGopFi6EAGtEy6MCMNnS21Q77921Y-a" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">W</span><a href="https://input.club/whitefox/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">hitefox</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="416" src="https://lh4.googleusercontent.com/7AK1dKH84AVim6913-5-RiSyZfr2PATK2sHRQ2XAAgmQTIvIOH4adBiAjxtI2A1s8ESfad7heaoaT22SXqHb_5KXxTMx1OAudymtLBWPUlXCFlEcR1IUl8_9fk8HP6PqEZDXYepv" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://input.club/devices/infinity-ergodox/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Infinity ErgoDox</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="416" src="https://lh6.googleusercontent.com/ryJllZYs-5VBAObQCl7-7YibZaqFcMgev-gvoOzCSO55Bcjqk9j1ThlV6weO3ZDaBAgkL7pFdx1yDlj0U0fGOlQf-QD3r-xjO6msNRWoxjDfi6a4VoivAs9mnnlyA2LClskMHDAz" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://input.club/k-type/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">K-Type</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키보드 구경은 그만하고 다시 스프링을 다루겠습니다. 스프링의 반발력의 기준은 키가 완전히 눌렸을 경우의 탄력을 의미합니다. 보통 Cherry MX 스위치는 키를 4mm까지 누르면 축이 더이상 내려가지 않습니다. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="500" src="https://lh4.googleusercontent.com/M1f0TC1YQPnVlRKCG0bGRnc5QdXRlGmFNVt4hky-kQCRSw5Yg0KVhRHojl832m8cESllunmbh-tP4G8iff0BpecEp4hu_IYzT4_9VMSCY3GCP0GEyuHaYiVV6DGa0HvVA_xQywBP" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="500" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://input.club/the-comparative-guide-to-mechanical-switches/linear/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">리니어 스위치</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">축이 하부 하우징에 닿으면 당연히 더이상 내려가지 않을 것입니다. Cherry MX 스위치는 이 거리가 4mm입니다. 다음 그래프는 </span><a href="https://input.club/the-comparative-guide-to-mechanical-switches/linear/cherry-mx-red/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">InputClub의 스위치 관련 자료</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서 다운로드 받은 것입니다. 가로축은 스위치가 눌린 거리이고, 세로축은 축과 스프링이 만들어 내는 힘을 나타냅니다. 파란색 선은 누를 때에 사용되는 힘을 나타내고, 주황색 선은 손을 뗄 때에 사용되는 힘을 나타냅니다. 우선 파란색 선을 중심으로 살펴보겠습니다. 가로축 4mm에서 사용되는 힘은 약 55gf입니다. 즉 스위치가 완전히 눌러졌을 경우, 스프링의 반발력이 54gf라는 의미입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="583" src="https://lh4.googleusercontent.com/bQlZONJEIgLHSfEPBOMoQ25dhdXqkgEFN1b-hA7gkrRZ5uc37viUkQeS2tZI8b2XvAOgY_v3Yxp9Q_4Dt1krN3_iH0c0Aw-LQsx3zIdo4L9nwTvl9RQ7OwMmQ0ff68gRP_IJ1wUF" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 표는 Cherry MX Red 관련 수치입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="311"></col><col width="314"></col></colgroup><tbody>
<tr style="height: 20pt;"><td style="background-color: #f9f9f9; border-bottom: solid #d3d3d3 0.75pt; border-left: solid #d3d3d3 0.75pt; border-right: solid #d3d3d3 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.8479999999999999; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Style</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #d3d3d3 0.75pt; border-left: solid #d3d3d3 0.75pt; border-right: solid #d3d3d3 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.8479999999999999; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Linear</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Manufacturer</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stem Color</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Red</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Light</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile Method</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">None</span></div>
</td></tr>
<tr style="height: 27pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">LED Styles</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SMD RGB w/ lense</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Single color thru-hole</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile Peak Force</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(갈축 걸리는 부분의 최고 반발력)</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">None</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation Force(입력 시점 반발력)</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~37 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bottom-Out Force</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(바닥에서 튀어오를 때의 반발력)</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~54 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Spring Force(스프링 반발력)</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~54 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hysteresis Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~15 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Overall travel</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~4 mm</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile event</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">None</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~1.5 mm</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cross-point</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Gold plated cross-point</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">우리가 주목한 항목은 빨간색으로 표시해두었습니다. Bottom-Out Force(바닥에서 튀어오를 때의 반발력)과 Spring Force(스프링 반발력)이 동일하게 나타내고 있습니다. 다른 스위치도 이 두 수치는 동일하므로, 우리는 스프링 반발력을 보도록 하겠습니다. Cherry MX Red(적축) 스프링의 반발력은 약 54gf라는 것을 확인할 수 있습니다. 위의 그래프의 4mm 지점의 반발력과 동일합니다. 이제 우리는 각 스위치의 Force Curve(스위치를 누르는데 소모되는 힘을 나타내는 그래프)만 봐도 스프링의 반발력을 알 수 있을 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이번에는 Cherry MX Brown(갈축)을 살펴보도록 하겠습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="583" src="https://lh5.googleusercontent.com/cmq7DGKW2Y2OCG3jDTu2-N3f3rYwaaHjFx-O0L99A5ockiEiyVsjuK62tlNX8s44NMxCLN-iYh2Lv83dyhr9FKSLY2Scy_UNGrc12HZigald759JNIkWOqQqmzD18rKnX68McuKM" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="313"></col><col width="311"></col></colgroup><tbody>
<tr style="height: 20pt;"><td style="background-color: #f9f9f9; border-bottom: solid #d3d3d3 0.75pt; border-left: solid #d3d3d3 0.75pt; border-right: solid #d3d3d3 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.8479999999999999; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Style</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #d3d3d3 0.75pt; border-left: solid #d3d3d3 0.75pt; border-right: solid #d3d3d3 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.8479999999999999; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Manufacturer</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #d3d3d3 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stem Color</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Brown</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Light</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile Method</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Metal Leaf</span></div>
</td></tr>
<tr style="height: 27pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">LED Styles</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SMD RGB w/ lense</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Single color thru-hole</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile Peak Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~45 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~37 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bottom-Out Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~55 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Spring Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: red; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~55 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hysteresis Force</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~18 gf</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Overall travel</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~4 mm</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tactile event</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~1 mm</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actuation</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~2 mm</span></div>
</td></tr>
<tr style="height: 17pt;"><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cross-point</span></div>
</td><td style="background-color: #f9f9f9; border-bottom: solid #e0dede 0.75pt; border-left: solid #e0dede 0.75pt; border-right: solid #e0dede 0.75pt; border-top: solid #e0dede 0.75pt; padding: 3pt 3pt 3pt 3pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #747474; font-family: "arial"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Gold plated cross-point</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그래프와 표를 기본으로 스프링의 무게를 쉽게 파악할 수 있습니다. 그래프의 4mm 지점의 힘은 약 55gf이고, 이 값은 당연히 표와 일치할 것입니다. 적축과는 다르게 Tactile Peak Force가 있습니다. 갈축의 돌기에 걸리면서 적축보다 더 많은 힘이 사용됩니다. 돌기에 걸리는 부분 중 최고 힘은 약 45gf입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그리고 두 축은 키가 입력이 되는 시점에서의 사용된 힘은 37gf로 동일합니다. 적축의 경우에는 입력 시점의 힘이 중요합니다. 키가 입력되기 위해서는 반드시 37gf 이상의 힘이 필요합니다. 흔히 구름타법으로 적축을 칠 수 있는 이유도 37gf의 힘만 가하면 입력이 발생하기 때문입니다. 물론 구름타법으로 갈축을 칠 수 있습니다. 하지만 갈축의 돌기때문에 입력 시점의 힘(Actuation Force)인 37gf가 아니라 Tactile Peak Force인 45gf를 넘어야 합니다. 그래야 입력이 발생합니다. 즉, 갈축과 같은 돌기가 있는 축은 Tactile Peak Force가 가장 중요합니다. 이는 청축 계열도 마찬가지입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스프링을 바꿔보자</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 스프링의 반발력을 알았으니 자신이 원하는 스프링만 찾으면 됩니다. 스프링을 선택하는 방법은 단순합니다. 적축을 사용하고 있는 경우를 가정하고 진행해보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">적축은 상당히 가벼운 스위치입니다. 너무 쉽게 눌러져서 아쉬운 사람은 조금만 더 묵직하고 쫀득하면 좋겠다는 생각을 할 것입니다. 적축과 같은 리니어(linear) 계열은 축의 모양이 동일하므로 스프링을 통해서만 변화를 줄 수 있습니다. 물론 흑축을 구매할 수도 있습니다. 하지만 흑축은 생각보다 스프링의 반발력이 큽니다. 자료에 따르면 적축의 스프링 반발력은 약 75gf이고, 입력 시점의 힘은 약 55gf입니다. 적축을 끝까지 눌렀을 때의 힘을 가해야만 비로소 입력이 발생합니다. 물론 이 정도로 묵직한 스위치를 원하는 사람에게는 좋은 선택이 될 수 있습니다. 하지만 적축보다는 묵직하고 쫀득하지만 흑축보다는 경쾌했으면 좋겠다는 사람도 있기 때문입니다. 다른 제조사의 축을 선택할 수도 있습니다. 이 경우는 제외하고 스프링을 변경해서 원하는 느낌을 만들도록 하겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">우리가 선택할 스프링의 반발력은 55gf에서 75gf 사이일 것입니다. 흔히 판매하는 스프링의 반발력은 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="409" src="https://lh6.googleusercontent.com/luETBUdQAP3yZMItnWRlhgHpaLVcvubEph6XHzti4anZOnP9Eo0zj_pHrCM9Gw02r0K2RNDogvO5SpjL_GbGrw2Ud1dg5mIBCcpY8eT0cqm3PlI48hdE7udc_dNN_tOWKA-F09EE" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://www.aliexpress.com/item/100pcs-Switches-Spring-for-Cherry-MX-DIY-Mechanical-Gaming-Keyboard-35G-40G-45G-60G-62G-67G/32795730832.html?spm=2114.10010108.1000014.1.5b32a4904zxDoD&traffic_analysisId=recommend_3035_null_null_null&scm=1007.13338.80878.000000000000000&pvid=6bcd94c2-c35e-48f6-a955-3243417a6945&tpp=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">알리익스프레스</span></a></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">주의할 점은 위에 표시된 무게는 입력 시점 힘(Actuation Force)으로 표현된다는 점입니다. 적축과 갈축의 경우, 이 값은 37gf였습니다. 그러므로 45gf를 선택하면 좀더 묵직하고 쫀득한 느낌을 받을 수 있습니다. 반대로 30gf를 선택하면 키가 훨씬 누르기 편해질 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">커스텀 키보드 관련 제품을 판매하는 </span><a href="http://winkeyless.com/product/springs/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Winkeyless(우리나라 사이트)</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서는 55g, 58g, 62g 스프링을 판매하고 있습니다. 여기서의 수치는 스프링 반발력, 다시 말해 키 스위치가 끝까지 눌렸을 때의 힘을 의미합니다. 적축과 갈축의 이 힘은 55gf이므로 58gf와 62gf 스프링을 선택하면 원하는 결과를 얻을 수 있을 것입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스프링 교체 예시</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 글을 작성하는 스위치는 갈축의 스템과 청축의 스프링을 조합한 것입니다. 청축의 반발력을 적축과 갈축의 스프링과 동일하다고 착각하는 사람도 있습니다. 저도 예전에 그렇게 생각하였습니다. 하지만 Input Club의 실측 그래프를 보면 약간의 차이가 있음을 알 수 있습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="583" src="https://lh4.googleusercontent.com/9Ryk_yIUvNOmDv4ugTegbppGCS-4Yp8YzDPO2M1sJaHETfKEsZEHM5yy6zLgIX8Z_w1PBHM_jSzcM-w41gMpwIKczvD2dR_jfqB32l5VLKTK6QmSwkMep0U9U8SkiCs0PHh8Q5eO" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그래프에 따르면 스프링의 반발력은 60gf를 가리키고 있습니다. 확실히 적축과 갈축의 스프링보다 5gf 무겁다는 것을 알 수 있습니다. 실제로 갈축 스템에 청축 스프링을 넣어서 사용해본 결과, 이전 갈축과는 다르게 묵직함이 추가되었다는 것을 느낄 수 있었습니다. 갈축이 살짝 가벼운 느낌이었다면 스프링의 반발력이 강해진만큼 단단하고 도각도각 거리는 느낌이 강해졌습니다. 하지만 이 글을 작성하면서 장시간 사용하면서 약간의 피로도 느껴집니다. 그래서 저는 58gf 스프링을 사용해볼 예정입니다. 무겁지도 가볍지도 않는, 저에게 딱 맞는 스위치를 얻을 수 있을 것으로 예상됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">추가로 Ergo Clear라는 조합도 가능합니다. Clear축의 스템과 적축 혹은 갈축의 스프링을 조합한 경우입니다. 이 스위치에 대한 자세한 내용, 스위치 분해 및 스프링 교체에 대한 글은 </span><a href="https://mooneegee.blogspot.kr/2017/09/it-cherry-mx-ergo-clear.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">여기</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">서 확인할 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">마치며</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치를 바꿔도 완벽함을 추구하지 못한 사람들은 스위치를 분해해야만 합니다. 그리고 스프링도 교체할 것입니다. 잘 구축되어 있는 데이터를 참고하여 자신만의 스위치를 잘 디자인하길 바랍니다. 참고할만 자료는 다음과 같습니다.</span></div>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://input.club/the-comparative-guide-to-mechanical-switches/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">InputClub 스위치 Force Curve 모음</span></a></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="http://wiki.geekhack.org/index.php?title=Cherry_MX" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">재미있는 커스텀 스위치 제조법</span></a></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="http://winkeyless.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">스프링 구매 사이트</span></a></div>
</li>
</ul>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com1tag:blogger.com,1999:blog-8901079106297905449.post-57966552426448699472017-10-18T21:09:00.000+09:002017-10-18T21:40:47.583+09:00[C#] 메모리 관리와 가비지 콜렉션(garbage collection) - 가비지 콜렉션을 유발하는 예시<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개요</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 글은 다음과 같은 항목으로 구성되어 있습니다. 그리고 오늘은 가비지 콜렌셕을 정리하도록 겠습니다.</span></div>
<b id="docs-internal-guid-021e5659-2f5e-7222-3ccb-1b7f346902bb" style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection-type.html">Type에 대한 이해(Value Type과 Reference Type</a><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection.html">)</a></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection.html">메모리 할당과 해제(스택과 힙)</a></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-variant-caps: normal; font-variant-ligatures: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><i><b>가비지 콜렉션(Garbage Collection)</b></i></span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금까지 Type에 대한 이해를 바탕으로 메모리 할당과 해제 대해서 알아보았습니다. 가비지 콜렉션이 발생하는 경우에 대해서도 이미 설명하였습니다. 이번에는 클래스의 instance가 참조하는 구조체와 같은 실제 상황을 예시로 지금까지의 내용을 적용해서 설명하려고 합니다. 그리고 이번 글을 끝으로 C#의 기본적인 가비지 콜렉션에 관한 연재는 마치도록 하겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">클래스에서 참조하는 구조체</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Windows Forms 애플리케이션은 예시로 설명하도록 하겠습니다. Windows Forms를 예시로 사용하지만 Windows Forms이 무엇인지는 중요하지 않습니다. 클래스와 구조체가 메모리에서 어떻게 다르고 관리되는지를 알고 있기만 하면 전혀 새로운 내용은 없습니다. Type에 대해서 잘 이해하고 있고, 메모리가 어떻게 할당되고 해제되는지를 알고 있다면 오늘 설명은 복습하는 기분으로 보고 넘어갈 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 간단한 코드로 클래스와 코드를 보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Size s = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Size (</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// 구조체. value type입니다.</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Font f = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Font (</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Arial"</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// 클래스. reference type입니다.</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여기서 Font 클래스는 중에는 Size 구조체도 있습니다. 그림으로 보면 좀더 구체적으로 알 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="215" src="https://lh4.googleusercontent.com/J_hJtGCg3D4WJUz8IhW6nxocMf1XA6mtlvNlW-pPti-FEgjG2z3aYu0nu5cWa6Zs5kBOrstgkZ5vS4k6P1DO-evVeA7tFEHs6evCXTCfiSRqpFclyvirftDzKo9e6t6b3rgIE0rt" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="494" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 Font의 instance가 하나 생성되었습니다. Font는 클래스, 즉 reference type이므로 힙(heap)에 생성됩니다. 그리고 reference type을 가리키는 변수 f는 스택(stack)에 생성됩니다. 이전 글에서 설명하였듯이 reference type을 가리키는 변수는 스택에 생성됩니다. Size가 하나 생성되었습니다. Size는 구조체, 즉 value type이므로 스택에 생성됩니다. 이 구조체를 가리키는 변수 s도 역시 스택에 생성됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference type인 클래스의 instance만 힙에 생성되었고, 나머지는 모두 스택에 생성된 상황입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여기서 새로운 클래스 Form이 등장합니다. Form은 Size와 Font를 멤버변수로 가지는 클래스입니다. Form의 instance를 하나 생성하겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form myForm = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form();</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form의 멤버변수 Size와 Font에 앞의 변수 s와 f를 대입하도록 하겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">myForm.Size = s;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">myForm.Font = f;</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금까지의 메모리 상황을 그림으로 살펴보면 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="300" src="https://lh6.googleusercontent.com/0gCgF-WcSErOTDfA7EIVrRK3ROVDHA06oaElQVR9lwKkspElZd63iejPV2hD5UICjARWD6rfp49I3XGfBkS433ZjHhfVAZSLuADe39El1PG7wAQRtEgwyW9ZvboBLRQJfhEEA3QD" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="535" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그림을 보면 새롭게 힙에 생성된 Form instance를 볼 수 있습니다. Form은 Size와 Font를 멤버변수로 가지고 있습니다. reference type을 가리키는 변수 myForm은 스택에 생성되어 있습니다. 그리고 myForm의 멤버변수 Size는 구조체이지만 reference type인 Form 클래스에 포함된 것이므로 힙에 생성됩니다. Font도 Form 클래스에 포함된 것이므로 힙에 생성됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그리고 myForm.Size에 미리 생성해둔 s를 대입합니다. 이전에 설명드렸듯이 value type을 대입하면 값이 복사됩니다. 즉, Size s의 복사본이 힙에 생성됩니다. myForm.Font에도 미리 생성해둔 f를 대입합니다. reference type의 변수를 대입하면 복사본이 생성되지 않고 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가 그대로 대입됩니다. 지금까지 설명한 내용이 모두 적용된 결과가 바로 위의 그림입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그러므로 myForm.Size는 s가 가리키는 Size와는 별개의 구조체입니다. myForm.Font는 f가 가리키는 Font와 동일합니다. 만약 s를 통해서 Width, Height를 수정하면 myForm.Size에 전혀 영향을 주지 못합니다. f를 통해서 FontFamily, Size 등을 수정하면 myForm.Font도 수정됩니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가비지 콜렉션을 유발하는 예시</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">코드를 먼저 살펴보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ExampleScript</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[] </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RandomList</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> numElements) {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">var</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> result = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[numElements];</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> i = </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; i < numElements; i++) {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> result[i] = Random.</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">value</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> result;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">기능은 매우 단순합니다. int로 갯수를 전달하면, 그 수 크기의 배열을 힙에 생성합니다. 만약 이 함수가 매우 잦게 호출된다면 어떻게 될까요? 호출될 때마다 배열이 생성될 것이고, 이 배열의 참조를 유지하지 않는다면 이 배열은 가비지가 됩니다. 이렇게 생성되는 가비지를 막으려면 다음과 같이 수정하는 것이 좋습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ExampleScript</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RandomList</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[] arrayToFill) {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> i = </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; i < arrayToFill.Length; i++) {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> arrayToFill[i] = Random.</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">value</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">차이는 간단합니다. 앞의 코드에서는 함수 내에서 새로운 배열을 만든 반면에, 이 코드에서는 배열을 매개변수로 전달받습니다. 더이상 힙에 새로운 배열이 생성되지 않습니다. 인자로 전달한 변수에 대한 참조만 잘 유지된다면, 이 배열은 가비지가 되지 않을 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">또 다른 예를 살펴보겠습니다. 다음 함수는 매 프레임 실행되는 함수입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Update</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> List myList = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> List();</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> DoSomething(myList);</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">단순한 함수입니다. 매 프레임마다 새로운 List를 생성하고, 이 List를 가지고 어떤 일을 합니다. List는 당연히 클래스입니다. 그러므로 매 프레임 우리는 List를 힙에 생성하고, Update() 함수를 빠져나오면 생성된 List는 모두 유효한 참조가 없으므로 가비지가 됩니다. 가비지를 생성하지 않도록 코드를 수정하면 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">private</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> List myList = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> List();</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Update</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> myList.Clear();</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> DoSomething(myList);</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Update() 함수가 매 프레임 실행되므로 이를 계속 생성하지 않고, 차라리 멤버변수로 가지고 있습니다. 이제 힙에는 한 개의 List만 생성됩니다. 매 프레임 이 List를 비워서 재사용합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 외에도 가바지를 유발하는 예시는 구글링하여 쉽게 찾을 수 있습니다. 각 예시를 보면서 지금까지 다룬 내용을 바탕으로 따져보면 좋을 것입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">정리하며</span></h1>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금까지 우리는 C#의 Type, 메모리 할당과 해제를 통해서 가비지가 어떻게 생성되는지 알아보았습니다. 매 프레임 적은 양으로 생성되는 가비지는 언제 수거되어 메모리를 해제할지 우리는 알 수 없습니다. 문제는 가비지를 수집하고 메모리를 해제하는 것이 결코 가벼운 일이 아니라는 것입니다. 특히 CPU가 바쁘게 돌아가는 중에 가비지 콜렉션이 동작하면 이용자에게 불편함을 줄 수도 있습니다. 평소 가비지를 생성하지 않는 코드를 작성하는 습관을 가질 수 있도록 노력해야 겠습니다.</span></div>
<div>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-49467624825477221892017-10-17T22:22:00.004+09:002017-11-06T21:30:13.513+09:00[IT 제품 구매가이드] Planck 키보드와 XDA 키캡<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드와 XDA 프로파일 키캡</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">드디어 기다렸던 키캡이 도착하였습니다. Planck 키보드를 만들면서 임시로 다른 키보드의 키캡을 뽑아서 사용하였습니다. 잘 어울리지도 않은 키캡을 억지로 사용하였지만 이제 그것도 끝입니다.</span></div>
<b id="docs-internal-guid-b678da77-2a7b-ae84-26a9-337aadc95b77" style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 오늘 소개할 키캡은 XDA 프로파일 키캡입니다. 기계식 키보드를 사용하다 보면 처음에는 키보드를 꾸미는 용도로 접근하였다가 키캡에 따라서 키를 누르는 느낌과 소리가 달라지는 것을 알게 됩니다. 키캡도 기계식 키보드에 상당히 중요한 부품 중 하나 입니다. 저도 아직 많은 종류의 키캡을 사용해보지는 않았기 때문에 자세히 설명드리기는 힘듭니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여튼 오늘은 XDA 프로파일 키캡을 간단히 소개하려고 합니다. 먼저 XDA 키캡으로 교체한 Planck 키보드입니다. </span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh5.googleusercontent.com/4B4cEm6LtmF9J3FXK8Dp8_UFi-GkMBh4aetHFHJAYPLV-4T-kP7TkQ9xkt5ZYh6hVQQj1QIjccby5qwFDivr-ssWFS8wNN8oI8hGTNeJAyCCZsWpTqiESVzcxScJiYLr-reaYOi7" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh6.googleusercontent.com/B7VjrmgHiqp9zXu7LUFq6WYrJwnKXBgfqF1csMh409RvIAF-Gc9w6pEnQjDfuNnMCT279tSUpe7a7u44MdtinMqpwoWqs8s8aMsbKEA9tJE2f-XUtMsWoxs5tX2UGBGQk7YVllhX" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드와 잘 어울립니다. 이 키캡은 일반 키캡과 달리 평평한 형태로 되어있습니다. 이게 어떤 의미인지 보통 키캡을 보면 알 수 있습니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="200" src="https://lh5.googleusercontent.com/VTtfjBU9lWuA7WRlhlpXQpOnUNY5Vhv8z3yTUVasnWROWW1srviuUX-RzaI7XMqN9NmNLDB08ANz9ebtsO7QQdvojQkNmu4ovP42n5Tk32DFZjDslrQVIBbIG11xHzd4DF45k1jY" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<a href="https://geekhack.org/index.php?topic=69133.0" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://geekhack.org/index.php?topic=69133.0</span></a></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저렇게 오목한 형태로 배열이 이루어진 이유는 편의성 때문입니다. 이런 형태는 손가락이 펴야 닿을 수 있는 곳의 키는 높게 만들어서 좀더 누르기 싶게 만들어 줍니다. 하지만 Planck 키보드와 같은 작은 크기의 키보드는 오목한 형태로 배치하지 않더라도 어렵지 않게 키를 누를 수 있습니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="476" src="https://lh3.googleusercontent.com/Lj7Lp8yHrQ50BCV6nNoXRDmneOwYlrL8yf3TVHKKTbhxHVx-yGUhGRo89iguFE1Ih8L5mwA3tr_mUY4sGWfD1V-wZI4PYJPQ6QhRYbhVhU6qCoPWjEc_dIuIhQXpfY9bQd3Z11Cc" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 사진에서 볼 수 있듯이 모든 키의 높이는 균일합니다. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">윗면이 보통 키캡에 비해서 많이 넓고 넙적합니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh3.googleusercontent.com/93Bx-WnmGtdZubqNintUa3eCEkDofX1f9JanFlybtXqUPTSNNNB6_TPHVzZshQP8puNbxFJhxvKijpur7p2enNWQtrJrkNqzR8hWvYEEPUXeKNcKDGthIRGObnc6cDa6QHSoMcwG" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">세로변은 둥그렇게 곡선을 이루고 있습니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh4.googleusercontent.com/ve9vp3uZ-rEs2iRLRG92ZvOGc-meUSjJ7AZle7ZKB2dHjPeDuOyyrUX69oG_026teiPVYj4pjxXcv0le5_4vJk27qKOphZR-N6IuOcCDzJgv9Hnq82lPRaqzHSRnBHY8KgGRXJkZ" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">어디서 본듯한 초콜렛 과자 모양 같기도 합니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh6.googleusercontent.com/TG-air6Trl_S2keahKf5lNnBIPfucCucQdMlzd89xL-MqWmDdd5xW9nP__KJP_gvwD0nmbxt1kqspvdfDh2K9RMY3ItkrS24vHK0lgP28Ilp4yJ82VF-jx1uroHsMuZZhmKIHzf6" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키캡 두께는 그렇게 두껍지는 않습니다. 그렇다고 얇은 편도아닙니다. 가장 흔한 두께입니다. 레오폴드나 볼텍스 키보드의 키캡보다는 얇습니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh6.googleusercontent.com/fL7mNteMG5QH1eJIBZMp6IpTVUeo5s9rV6dn-XVLszYbY--x2xqQnGdAw7ay1ouiZvXNClJddF70yQD3XFQzug4LjqhaHaivqsL6-SuqGwuAjBCRt3hsOcNvsCoBudE4bwlyezw6" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">일반 키캡 중 가장 낮은 K 키캡과 가장 높은 숫자 키캡과 비교하였습니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh3.googleusercontent.com/5EctMpgcwQyb9MKJux12Zr607hXZf7D5RuODcgSIsr-kbdTCVX-4-kjXiWn2epgBQ_wb_3RjBAEVpOv3gpzkoNnEKW7eoGu7Z3DluYfEN8CsPm9Q2t_rS_MIMZbDFSwsCf4UwiQX" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">전체적으로는 조금 낮아진다고 생각하면 됩니다. 대표적으로 납작한 키캡인 DSA와 비교하면 살짝 높은 편입니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 사진은 체리 프로파일 키캡을 사용하던 당시에 찍었던 사진입니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="476" src="https://lh6.googleusercontent.com/nfc7oCK2_ehfZb4m6EKNsIkf-vSWHERe7IK5NeeXYCN3x77wxpqHJbP2aBMCq1PjOA6Wd8PGlFslvQJRFCql3057sui2im6TozXuxOjXGcQA3Sti2TJ0Pphn2Z_PHl8DrofeI568" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">XDA 키캡은 전체적으로 둥글고 둔하지만 귀여운 느낌입니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="360" src="https://lh3.googleusercontent.com/IaMwhI4FzCi-FmDq8r15aFPtO7e3pBff5HiYiDOzeWmSIJuzGwmW1qpQRzk6uScZwJtAMrnWy3AEZiOQSlSnhKC44Ed1_1xfsZtAG9lXJqkn16udCIDKhxOeo5uaz3UvzKtFbHfV" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br />
</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">XDA 키캡은 </span><a href="https://www.aliexpress.com/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">알리익스프레스</span></a><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">에서 ‘xda keycap’으로 검색하면 구매할 수 있습니다. 아직은 흔한 키캡은 아니라서 종류가 다양하지 않은 단점이 있습니다. 제가 구매한 키캡은 </span><a href="https://www.massdrop.com/buy/37220" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">massdrop</span></a><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">에서 구매하였습니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com3tag:blogger.com,1999:blog-8901079106297905449.post-84263584037785860892017-10-16T22:50:00.001+09:002017-11-01T16:01:06.543+09:00[C#] 메모리 관리와 가비지 콜렉션(garbage collection) - 메모리 할당과 해제<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개요</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 글은 다음과 같은 항목으로 구성될 예정입니다.</span></div>
<b id="docs-internal-guid-021e5659-2576-27d1-8f98-dbfe21d1f9f3" style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection-type.html">Type에 대한 이해(Value Type과 Reference Type)</a></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">메모리 할당과 해제(스택과 힙)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: consolas; font-size: 11pt; font-variant-caps: normal; font-variant-ligatures: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b><i>가비지 콜렉션(Garbage Collection)</i></b></span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이번 글에서는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>메모리 할당과 해제</b></span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에 대해서 알아보겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">메모리 할당</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금까지 C#의 value type과 reference type에 대해서 알아보았습니다. 좀더 명확하게 설명하기 위해서 value type과 reference type이 메모리에 어떻게 할당되는지 살펴보고자 합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CLR(Common Language Runtime)은 객체를 스택(</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stack</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)과 힙(</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">heap</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)에 할당합니다. 스택은 first-in last-out 메모리 구조입니다. 용어 그대로 먼저 들어온 데이터가 가장 마지막에 빠져나가는 형태입니다. 스택은 매우 효율적입니다. 메소드가 호출되면 CLR은 현재 스택의 최상단을 기록(bookmark)합니다. 이 메소드는 처리할 데이터를 스택에 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">push</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하고 실행합니다. 메소드가 완료되면, CLR은 스택을 이전 기록지점(bookmark)로 돌려놓습니다. 이 과정을 보통 “popping”이라고 합니다. 스택의 모든 메모리 관리는 push와 pop으로 간단하게 처리됩니다. 간단한만큼 효율적입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스택과는 달리 힙은 객체가 임의로 할당됩니다. 스택에서는 이전 메모리의 최상단에 데이터가 배치되었습니다. 힙이 나쁘기만 한건 아닙니다. 스택과 달리 힙은 객체를 힙 공간 내에 임의의 위치에 할당하고 해제할 수 있습니다. 잠시 후에 좀더 자세히 살펴볼 것이지만, 그래서 힙은 메모리 관리(memory manager)와 가비지 콜렉션(garbage collection)에 관련된 성능 부하가 발생합니다. 임의의 공간에 할당된 데이터를 관리하려면 스택과 달리 추가적인 관리가 필요하기 때문입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스택과 힙이 어떻게 사용되는지 확인하기 위해서 다음 메소드를 살펴보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CreateNewTextBox</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> TextBox myTextBox = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> TextBox(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// TextBox는 class</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 메소드는 TextBox의 instance를 생성하고, 지역변수(local variable) myTextBox가 그것을 참조합니다. </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지역변수는 스택에 저장되지만, instance 자체는 힙에 저장됩니다.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 다시 말해 TextBox는 클래스이기때문에 instance의 데이터는 힙에 생성되지만, 이를 참조하는 myTextBox는 지역변수이기때문에 스택에 저장됩니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="171" src="https://lh6.googleusercontent.com/VMDjllhM-zDVmZajenWRFjoObgShUJYmKbb7DK3ZgFNhhUfd7UaE5NFTUy91-fGvRhASpnuWP6gz8oqtrKIaxVyvwcljJVvWWpnw7OeiBPnom_ZtbnCa8TKr8Jw_JcK5Ah7Nba6Q" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="494" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 이미지를 보면 좀더 명확하게 그려질 것입니다. 클래스의 instance는 힙에, 이를 참조하는 지역변수는 스택에 존재하는 것을 알 수 있습니다. 가비지 콜렉션를 아시는 분은 이미 위의 예시 메소드가 가비지를 생성한다는 것을 알아차렸을 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여기서 스택과 힙이 각각 저장하는 대상에 대해서 알아보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스택은 다음 두 가지를 저장하기 위해 사용됩니다.</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference-type의 지역변수와 매개변수에 대한 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">참조자(reference). </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위의 그림에서 myTextBox reference를 가립니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Value-type의 지역변수와 메소드 매개변수(struct, integer, char, DateTiems 등등)</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">힙은 다음 두 가지를 저장하기 위해 사용됩니다.</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference-type의 instance가 포함하는 데이터</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference-type의 instance 내부에 구성된 모든 것들</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 이미지를 다시 살펴보겠습니다. TextBox로부터 생성한 instance 내부에는 Location, Size, Text 등등이 있습니다. 이 모든 것들은 reference-type 내부에 있는 것이므로 힙에 저장될 것입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">메모리 해제</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CreateNewTextBox()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수가 실행을 마치면, 지역 변수로 스택에 할당된 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">myTextBox</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스코프(scope)</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 벗어나게 되어 스택에서 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pop</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">됩니다. 하지만 힙에 할당되었고, myTextBox가 가리키고 있었던 instance는 어떻게 될까요? 사실 이 instance가 어떻게 되는지 걱정하지 않아도 됩니다. 왜냐하면 CLR(Common Language Runtime)의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가비지 콜렉터(garbage collector)</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가 잠시 후에 이런 instance를 찾아서 힙에서 해제(deallocate)하기 때문입니다. 가바지 콜렉터는 어떤 instance가 제거되어야 하는지 알 수 있습니다. 어떤 instance에 대한 유효한 참조가 더이상 없는 경우에 해당 instance를 해제하면 되기 때문입니다. C++ 프로그래머는 이런 방식에 조금 어색하거나 불편함을 느낄 수 있습니다. C++ 프로그래머는 해당 instance를 바로 제거하기를 원하기 때문입니다. 하지만 C#은 해당 instance를 명시적으로 제거할 수 있는 방법이 없습니다. 우리는 CLR의 메모리 해제에 의지해야만 합니다. ‘.NET 프레임워크’는 모두 마찬가지입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CreateNewTextBox() 함수를 좀더 살펴보도록하겠습니다. 함수가 실행되어 TextBox의 instance가 하나 생성되면 메모리에는 다음과 같은 일이 벌어집니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="171" src="https://lh6.googleusercontent.com/VMDjllhM-zDVmZajenWRFjoObgShUJYmKbb7DK3ZgFNhhUfd7UaE5NFTUy91-fGvRhASpnuWP6gz8oqtrKIaxVyvwcljJVvWWpnw7OeiBPnom_ZtbnCa8TKr8Jw_JcK5Ah7Nba6Q" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="494" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TextBox의 instance가 힙에 생성되었습니다. 이 instance를 참조하는 지역변수 myTextBox는 스택에 저장됩니다. CreateNewTextBox() 함수가 실행을 마치고, 스택은 이전의 최상단(top)으로 돌아가게 됩니다. 이 과정에 지역변수 myTextBox는 제거됩니다. myTextBox가 제거되면 우리는 myTextBox가 가리키던 TextBox의 instance에 대한 유효한 참조난 하나도 남지 않습니다. 가비지 콜렉터는 이 instance를 바로 해제하지 않습니다. 힙 메모리 공간이 부족하지 않는 상태가 유지된다면 가비지 콜렉터는 대기합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">만약 힙 메모리 공간이 부족하게 되면 가바지 콜렉터는 힙 메모리 공간에서 유효한 참조가 없는 대상을 찾아 해제합니다. 이제 비로소 TextBox instance가 만들었던 가바지가 해제되었습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 자동 삭제(automatic destruction)에도 주의할 점이 있습니다. 메모리를 제외한 자원(특히 Windows handle, file handle, SQL handle 등의 handle)을 할당한 instance는 더이상 필요없어질 때에 handle이 제어하고 있는 자원을 명시적으로 해제하라고 요청해야 합니다. 여기서 이런 의문이 생길 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">“왜 객체의 finalizer에 그 자원(resource)를 해제하라는 코드를 넣지 않나요?”</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">finalizer는 instance가 파괴되지 전에 CLR이 실행하는 메소드입니다. 가비지 콜렉터는 메모리 문제에 관련있는 반면에, 자원 문제에 관련없습니다. 그래서 몇 기가 바이트의 메모리 공간을 가지고 있는 PC의 경우, 가비지 콜렉터가 한참 후에나 동작할 수도 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">자원 해제와 관련된 내용은 여기서 다루고자 하는 내용을 벗어나므로 생략하도록 하겠습니다. 궁금하신 분은 IDsiposable 클래스와 Dispose() 메소드를 확인해보시길 바랍니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">오늘 다룬 메모리 할당과 해제에 대한 지식을 바탕으로 <a href="https://mooneegee.blogspot.kr/2017/10/c-garbage-collection_18.html">가바지가 생성되는 상황</a>에 대해서 좀더 자세하게 다룰 예정입니다. 그리고 가비지 생성을 최소화하도록 주의할 점도 알아보겠습니다.</span></div>
<div>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-14872108095073583442017-10-15T20:07:00.000+09:002017-10-18T21:09:39.712+09:00[C#] 메모리 관리와 가비지 콜렉션(garbage collection) - Type에 대한 이해<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">들어가기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저의 첫 프로그래밍 언어는 C였습니다. C를 공부하면서 C++로 공부하기 시작하였습니다. 이후 C#을 사용하게 되었고, C 계열 언어라서 쉽게 사용할 수 있을 거라고 생각했습니다. 하지만 겉보기와는 다르게 C#은 C나 C++과 완전히 다른 특성의 언어라는 것을 얼마되지 않아서 알게 되었습니다. 특히 Value 타입과 Reference 타입에 대한 접근 방식은 생소하였습니다. 이 개념은 가비지 콜렉션(Garbage Collection)과도 관련된 개념이라서 중요합니다. 이번 글은 C#의 Value 타입과 Reference 타입의 차이를 살펴볼 것입니다. 이 차이를 이해해야 C#의 메모리 관리 및 가비지 콜렉션에 대해서 알 수 있습니다. 참고로 이 글은 C#에 대한 기초 지식이 필요합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개요</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 글은 다음과 같은 항목으로 구성될 예정입니다.</span></div>
<b id="docs-internal-guid-266ac154-1fc3-78f9-3b43-a43fcb624698" style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: consolas; font-size: 11pt; font-variant-caps: normal; font-variant-ligatures: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-variant-caps: normal; font-variant-ligatures: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b><i>Type에 대한 이해(Value Type과 Reference Type)</i></b></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection.html">메모리 할당과 해제(스택과 힙)</a></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection_18.html">가비지 콜렉션(Garbage Collection)</a></span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이번 글에서는 Type에 대해서 알아보겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">구조체(struct)</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">먼저 구조체(struct)를 살펴보겠습니다. 구조체가 무엇일까요? 상속과 객체를 소멸시킬 수 있는 finalizer를 지원하지 않는 클래스(class)를 상상해봅시다. 그게 바로 구조체입니다. 구조체는 class와 동일하게 정의됩니다. 방금 언급한 제한말고 또 다른 점은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">struct</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">라는 키워드를 사용한다는 것입니다. 나머지는 동일합니다. struct는 멤버 변수 및 함수를 가질 수 있고, property와 연산자(operator)를 가질 수 있습니다. 아래의 코드는 단순한 struct를 잘 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">struct</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Point</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">private</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> x, y; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// private fields</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> x, </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> y) </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// constructor</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">this</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.x = x;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">this</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.y = y;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> X </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// property</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">get</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> x;}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">set</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {x = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">value</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Y</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">get</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> y;}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">set</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {y = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">value</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;}</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">} </span></div>
</td></tr>
</tbody></table>
</div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Value Type과 Reference Types</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">앞에서 간단히 구조체와 클래스의 차이에 대해서 알아보았습니다. 이 차이에 대해서 좀더 살펴보려고 합니다. 사실 지금 언급하는 것이 가장 중요한 차이일 것입니다. 구조체는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">value type</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">입니다. 반면에 클래스는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference type</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">입니다. 프로그램이 실행되면 이 둘은 다르게 처리됩니다. value type instance는 생성되고, 값을 저장하기 위해서 메모리의 단일 공간에 할당됩니다. int, float, bool, char와 같은 기본(primitive) type도 value type이고 구조체와 같은 방식으로 처리됩니다. 프로그램이 실행되어 value type을 처리할 때, 기본적인 데이터를 직접 처리하기 때문에 매우 효과적입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 reference type object가 메모리에 생성될 때에는 포인터와 같이 분리된 참조로 제어합니다. 다음 코드의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">는 구조체이며 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">은 클래스라고 가정하겠습니다. 그리고 Point와 Form을 각각 하나씩 생성하겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point p1 = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Point(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Point는 구조체</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form f1 = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Form은 클래스</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 경우 p1을 위한 Point가 단일 메모리 공간에 할당됩니다. 반면에 f1을 위한 Form은 두 공간에 나누어져 할당됩니다. 하나는 Form 자체를 위한 공간이고, 다른 하나는 참조 f1을 위한 공간입니다. 지금부터 이 차이에 대해서 알아보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form f1; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Allocate the reference</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f1 = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Allocate the object</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 다음과 같이 객체를 새로운 변수에 복사합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point p2 = p1;</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form f2 = f1;</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">구조체 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p2</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">는 독립적인 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">p1</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 복사본이 됩니다. 이 독립적인 복사본은 분리된 자신의 field를 가집니다. 그래서 p1과 p2는 각각의 객체를 가리킵니다. 하지만 f2는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">reference</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">만 복사됩니다. 결과적으로 f1과 f2는 동일한 객체를 가리키고 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">메소드(method)에 매개변수를 전달할 때에는 이런 C#의 특성을 더 주목해야합니다. 매개변수는 (기본적으로) value로 전달됩니다. value로 전달된 매개변수는 묵시적으로 복사되는 것입니다. value-type 매개변수는 (p2의 경우와 같이) 메모리를 실제로 복사합니다. 반면에 reference-type 매개변수는 (f2의 경우와 같이) reference만 복사합니다. reference가 가리키는 메모리 공간을 복사하지 않습니다. 다음 코드를 살펴보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point myPoint = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Point (</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// value-type</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form myForm = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// reference-type</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test (myPoint, myForm); </span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (Point p, Form f)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> p.X = </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// myPoint에 영향없음. p는 myPoint의 복사본</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> f.Text = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Hello, World!"</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// f는 myForm과 동일 대상 가리킴.</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> f = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">null</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// f만 null, myForm은 여전히 유효</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">앞에서 언급하였듯이 value type을 매개변수로 전달하면 복사본을 생성합니다. Test() 함수의 p 매개변수는 myPoint의 복사본을 메모리에 생성하고, 그 복사본을 가리킵니다. 반면에 f 매개변수는 reference type이므로 myForm이 가리키는 instance을 복사하지 않고 참조인 myForm만 복사합니다. value type과는 다르게 reference 자체만 복사된다는 점에 주목합시다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test() 함수 내부에서 벌어지는 일을 더 자세히 살펴보겠습니다. 매개변수 p가 가리키는 대상은 myPoint가 가리키는 것과는 다른 복사본입니다. 그래서 p.X에 다른 값을 넣더라도 myPoint에는 영향을 주지 않습니다. 매개변수 f는 참조를 복사한 것이므로 f가 가리키는 대상은 myForm이 가리키는 것과 동일합니다. 그래서 f.Text 값을 변경하면 myForm.Text이 수정됩니다. 그런데 f에 null을 대입하면 myForm에는 아무런 영향을 미치지 않습니다. myForm도 null이 될 것으로 착각할 수도 있습니다. 하지만 f는 myForm이 가리키는 메모리 공간에 대한 참조입니다. f에 null을 대입하면 f는 더이상 이 공간을 가리키지 않습니다. 그러므로 myForm에는 영향을 줄 수 없습니다. myForm은 여전히 instance를 유효하게 가리키고 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">함수의 매개변수를 ref 한정어(modifier)를 사용해서 설정할 수 있습니다. “ref”로 전달하면 메소드는 호출자(caller)의 인자에 직접 접근할 수 있습니다. 아래의 예시 코드를 살펴보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Point myPoint = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Point (</span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// value-type</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Form myForm = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form(); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// reference-type</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test (</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ref</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> myPoint, </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ref</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> myForm); </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// 참조로 전달</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ref</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Point p, </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ref</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Form f)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> p.X = </span><span style="background-color: #333333; color: #d36363; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// myPoint.X 수정</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> f.Text = </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Hello, World!"</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// myForm.Text 수정</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> f = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">null</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; </span><span style="background-color: #333333; color: #888888; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// myForm에 null을 대입!</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Test() 함수의 매개변수는 모두 ref로 설정되어 있습니다. 만약 우리가 인자를 ref로 전달하면 인자의 type에 상관없이 모두 원본 instance에 접근하여 수정할 수 있습니다. </span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이번 글에서는 C#에서 value-type과 reference-type을 처리하는 과정이 어떻게 다른지 간단하게 살펴보았습니다. 다음에는 이 차이점을 메모리 관점에 좀더 상세하게 살펴보고자 합니다. <a href="https://mooneegee.blogspot.com/2017/10/c-garbage-collection.html">value-type과 reference-type이 스택(stack)과 힙(heap)에 어떻게 할당되고 해제</a>되는지 알아볼 것입니다. 이를 이해하면 C#의 가비지 콜렉션(garbage collection)은 쉽게 이해될 것입니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com2tag:blogger.com,1999:blog-8901079106297905449.post-78535650537988089452017-10-13T00:06:00.001+09:002017-10-24T00:09:11.181+09:00[Python] Flask URL Building - url_for()<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask URL 만들기(Building)</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">url_for()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수는 함수 이름으로 된 종단점(endpoint)의 URL을 생성합니다. 그리고 변수 규칙에 따라서 인자도 전달할 수 있습니다. 그래서 함수명을 첫번째 인자로, 하나 혹은 그 이상의 키워드 인자를 전달하면, 변수 규칙에 맞추어 이에 해당하는 URL을 생성해줍니다.</span></div>
<b id="docs-internal-guid-f24773e6-0eaa-3f81-ab7a-2e867d9b2a7c" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 script는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">url_for()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수를 어떻게 사용하는지 잘 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask, redirect, url_for</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/admin')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_admin</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello Admin'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/guest/<guest>')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_guest</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(guest):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello %s as Guest'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> % guest</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/user/<name>')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_user</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(name):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name ==</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'admin'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> redirect(url_for(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello_admin'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">))</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> redirect(url_for(</span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello_guest'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, guest = name))</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위의 스크립트의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_user(name)</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수는 URL에서 인자의 값을 전달받습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_user(name) 함수는 먼저 전달받은 인자가 ‘admin’과 일치하는지 확인합니다. 만약 일치한다면 애플리케이션은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">url_for()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 사용하여, </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_admin()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수로 리다이렉트(redirect)합니다. 일치하지 않는다면, 전달받은 name 인자를 guest 매개변수로 사용하여 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_guest()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수로 리다이렉트합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위의 코드를 저장하여 실행합니다. 그리고 웹 브라우저를 열어 다음 URL을 입력합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: transparent; color: #880000; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//localhost:5000/user/admin</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">결과는 쉽게 예상할 수 있습니다. 코드는 주어진 URL을 라우팅합니다. 우리가 정해둔 라우팅에 따라 hello_user(name)이 호출될 것입니다. URL의 name을 확인하여 리다이렉트합니다. name은 admin이기 때문에 hello_admin()으로 리타이렉트됩니다. 결국 ‘Hello Admin’이 반환됩니다. 우리는 브라우저에서 Hello Admin을 볼 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 다른 URL을 입력해보겠습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: transparent; color: #880000; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//localhost:5000/user/mooneegee</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">결과를 예상해보겠습니다. 전달된 URL은 라우팅되어 hello_user(name)을 호츨할 것입니다. mooneegee는 이 함수의 인자로 전달됩니다. 그 다음 hello_guest() 함수로 리다이텍트되고, 인자로 mooneegee를 전달합니다. 마직막으로 ‘Hello mooneegee as Guest’반환합니다. 우리는 브라우저에서 이 반환된 문자열을 볼 수 있습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WWW(월드 와이드 웹)에서 데이터를 주고 받는 바탕인 <a href="https://mooneegee.blogspot.com/2017/10/python-flask-http-get-post.html">Http 프로토콜과 이와 관련된 Flask API</a>를 살펴볼 것입니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-28036762277266352872017-10-10T19:58:00.000+09:002017-10-10T22:45:08.353+09:00[Python] Flask 변수 규칙(Variable rules)<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask 변수 규칙</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">변수 부분을 rule 매개변수에 추가하면 동적으로 URL을 만들 수 있습니다. 이 변수 부분은 <variable-name>으로 표시합니다. 즉, <>안에 변수 이름을 설정해서 사용할 수 있습니다. 변수 부분은 키워드 인자로 rule에 관련된 함수에 전달됩니다.</span></div>
<b id="docs-internal-guid-f24773e6-05eb-1750-757f-8b941ecd8e6f" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 예제에서 route() 데코레이터의 rule 매개변수는 URL ‘/hello’에 붙어있는 <name> 변수 부분을 포함하고 있습니다. 그러므로 만약 브라우저에 URL을 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello/my_name</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">으로 입력하면 ‘my_name’는 hello_name(name)의 인자로 전달됩니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/hello/<name>')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_name</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(name):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello %s!'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> % name</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 코드를 저장하고 실행한 후에 브라우저 주소창에 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello/my_name</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 입력합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그러면 브라우저에 다음과 같은 결과가 나타납니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>Hello my_name!</b></span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b><br class="kix-line-break" /></b></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">변수 부분의 기본 자료형은 string입니다. rule은 변환자(converter)에 따라서 자료형을 설정할 수 있습니다. 변환자는 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 정수(integer)로 사용합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 부동소수 값(float)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">path</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 디렉토리에 사용된 ‘/’를 독립된 character로 사용합니다.</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 코드는 이 변환자를 어떻게 사용하는지 보여줍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/blog/<int:postID>')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">show_blog</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(postID):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Post Number %d'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> % postID</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/rev/<float:revNo>')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">revision</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(revNo):</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Revision Number %f'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> % revNo</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 코드를 실행시키고, 브라우저 주소창에 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/blog/11</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 입력합니다. 결과를 예상해봅시다. Flask 애플리케이션, 우리가 작성한 코드는 http://localhost:5000/blog/11를 라우팅합니다. http://localhost:5000가 메인 페이지가 되고, 그 다음에 나오는 /blog/11가 @app.route(‘/blog/<int:postID>’)에 의해서 라우팅됩니다. 그리고 이것과 연결된 show_blog(postID)가 호출됩니다. 이 때 변환자에 의해서 postID가 int 자료형으로 변환되어 반환됩니다. 결과는 다음과 같습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>Post Number 11</b></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/rev/10.1</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 브라우저 주소창에 입력하면 어떻게 될까요? 한번 예상해보고 실행해보길 바랍니다. 여기서 주의할 점은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/rev/10</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">을 입력하면 404 Not Found 에러가 발생합니다. 라우팅할 주소의 자료형을 맞춰주어야 하기 때문입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이런 Flask의 URL rule은 Werkzeug의 라우팅 모듈을 기본으로 합니다. Flask의 URL rule은 URL이 고유한지, Apache의 선례를 따르는지 확인합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 스크립트에서 정의된 rule을 고려해봅시다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/flask')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello Flask'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/python/')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_python</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello Python'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_home</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello Home'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run(debug = </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">‘/flask’와 ‘/python/’이 비슷하게 보일 것입니다. 차이점은 ‘/python/’의 끝에 (</span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">)가 사용되었다는 점입니다. 결과적으로 표준의 URL이 됩니다. 그래서 /python 혹은 /python/을 입력하면 동일한 결과를 확인할 수 있습니다. 하지만 /flask/를 입력하면 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">404 Not Found</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"> 에러가 발생합니다.</span><br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><span id="docs-internal-guid-f24773e6-05ee-45a9-4818-7f45d383be69"></span></span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask의 리다이렉트(redirect)에 대해서 알아볼 예정입니다. 리다이렉트에 유용하게 사용할 수 있는 url_for() API도 함께 다룰 것입니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-31379175898568922082017-10-09T14:37:00.000+09:002017-10-10T22:45:00.158+09:00[Python] Flask 라우팅(Routing)<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"></span><br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"><span style="font-family: "consolas"; font-size: 20pt; vertical-align: baseline; white-space: pre-wrap;">Flask Routing</span></span></h1>
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a">
</span>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">현대 웹 프레임워크는 사용자가 애플리케이션의 URL을 기억할 수 있도록 도와주는 라우팅 기술을 사용합니다. 이 기술을 사용하여 홈페이지에서 탐색을 하지 않고도 원하는 페이지에 직접 접근할 수 있기 때문에 유용합니다.</span></span></div>
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a">
</span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Flask의 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">route()</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"> 데코레이터는 URL을 함수와 연결하는데 사용합니다. 예를 들면 다음과 같습니다.</span></span></div>
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a">
</span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><b id="docs-internal-guid-f24773e6-ffc4-ea8a-dd9b-323dead9860f" style="font-weight: normal;"><br /></b></span>
</span><br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/hello')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_world</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'hello world'</span></div>
</td></tr>
</tbody></table>
</div>
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">URL ‘</span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">/hello</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">’는 hello_world() 함수와 연결됩니다. 결국, 만약 사용자가 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">http://localhost:5000/hello </span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">URL을 방문하면, 이 URL과 연결된 hello_world() 함수의 반환값이 브라우저에 그려질 것입니다.</span></span></div>
<span id="docs-internal-guid-0383166b-ff9e-eb6e-112b-4baa54714c4a">
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">애플리케이션의 객체의 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">add_url_rule()</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"> 함수는 바로 위의 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">route()</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">처럼 URL과 함수를 연결할 수 있습니다.</span></div>
<span id="docs-internal-guid-f24773e6-ffc5-564f-c7fc-3de7ad497d7f"><br /><div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: #fcc28c; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: #ffffaa; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">hello_world</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: #fcc28c; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: #a2fca2; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">'hello world'</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">app.add_url_rule(</span><span style="color: #a2fca2; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">'/hello'</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="color: #a2fca2; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">'hello_world'</span><span style="color: white; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">, hello_world)</span></div>
</td></tr>
</tbody></table>
</div>
</span><br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">app.add_url_rule() 함수로 앞의 app.route()와 동일한 기능을 하도록 만들었습니다. Flask 문서에 따르면 route() 함수는 add_url_rule() 함수를 호출합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/python-flask_10.html">URL의 일부를 변수로 사용하는 방법</a>에 대해서 알아볼 것입니다. 그리고 이 변수를 함수의 인자로 전달하는 것도 다룰 것입니다.</span></div>
</span>Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-5894132078811461122017-10-09T02:52:00.000+09:002017-10-10T22:44:50.499+09:00[Python] Flask 테스트 - Hello World<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask 테스트하기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">설치한 Flask를 테스트하기 위해서, 사용하는 에디터에서 Hello.py 파일을 생성하고 다음 코드를 입력합니다. Hello.py는 처음 생성한 디렉토리의 루트 경로에 만들어야 합니다. 예를 들어, 저는 newproj/Hello.py를 생성하였습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #333333; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> flask </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Flask</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app = Flask(__name__)</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fc9b9b; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">@app.route('/')</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #ffffaa; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_world</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">():</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'Hello World'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: #fcc28c; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __name__ == </span><span style="background-color: #333333; color: #a2fca2; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'__main__'</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #333333; color: white; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> app.run()</span></div>
</td></tr>
</tbody></table>
</div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">반드시 프로젝트에 Flask를 모듈을 import해야 합니다. Flask 클래스의 객체는 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WSGI</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 애플리케이션 애플리케이션입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask 생성자는 current module(__name__)을 인자로 받습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask 클래스의</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> route()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수는 데코레이터(decorator)입니다. 이 데코레이터는 애플리케이션에 어떤 URL가 호출해야 하는 연관된 함수를 요청합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">route</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rule</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> options)</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rule</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 이 함수와 연결된 URL를 나타냅니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">options</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rule 객체에 전달될 인자 목록입니다.</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 예시 코드의 ‘</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">’는 URL은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hello_world()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 함수와 연결되어 있습니다.그러므로 브라우저에서 웹 서버의 홈 페이지가 열리면, 이 함수의 반환값이 화면에 그려질 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">마지막으로 Flask 클래스의 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메소드는 로컬 개발 서버에 애플리케이션을 실행합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">host</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> port</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> debug</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> options)</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">모든 인자는 선택적입니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">host</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 응답을 받는 hostname. 127.0.0.1(localhost)가 기본값. 외부에 사용가능한 서버는 ‘0.0.0.0’을 설정합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">port</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 기본값은 5000</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">debug</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 기본값은 false. 만약 true로 설정하면, debug 정보를 제공합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">options</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: Werkzeug 서버에 전달할 내용</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 Hello.py를 실행합니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">참고로 정상적으로 실행하기 위해서 준비되어야 하는 사항</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">virtualenv가 설치되어야 합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">virtualenv가 활성화되어야 합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask가 설치되어야 합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello.py가 디렉토리 루트에 위치해야 합니다.</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">위 사항은 이전 포스팅에 설명되어 있으므로 참고하시길 바랍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hello.py가 정상적으로 실행되면 다음과 같은 정보를 확인할 수 있을 것입니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #660066; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Running</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> on http</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: transparent; color: #880000; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//127.0.0.1:5000/ (Press CTRL+C to quit)</span><br />
<span style="background-color: transparent; color: #880000; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이제 127.0.0.1:5000(localhost)에서 웹 애플리케이션 서버가 동작합니다. 웹 브라우저의 주소창에 이 주소(hostname)를 입력하면 Hello.py 코드가 실행되어 응답을 줄 것입니다. 바로 ‘Hello World’를 브라우저에서 확인할 수 있습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debug Mode</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask 애플리케이션은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run()</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 메소드가 호출하여 실행됩니다. 하지만 애플리케이션을 개발 중이라면 코드가 수정될 때마다 수동으로 재시작해주어야 합니다. 이런 불편함을 피하기 위해서 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">debug mode</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 활성화해야 합니다. 서버는 코드가 수정되면 스스로 재시작됩니다. 그리고 debug mode는 애플리케이션에서 발생할 수 있는 에러를 편리하게 추적할 수 있습니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">debug mode는 애플리케이션의 debug를 True도 설정하여 활성화할 수 있습니다. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">debug </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #000088; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">혹은</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">debug </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #000088; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">실제로 Hello.py가 실행 중에 코드를 수정하면 다음을 확인할 수 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #660066; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Detected</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> change </span><span style="background-color: transparent; color: #000088; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #008800; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/mnt/d/Projects/newproj/Hello.py'</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> reloading</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #660066; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Restarting</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #000088; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">with</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> stat</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #660066; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debugger</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #000088; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">is</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> active!</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #660066; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debugger</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> PIN</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #006666; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">334</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #006666; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">372</span><span style="background-color: transparent; color: #666600; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #006666; font-family: "consolas"; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">594</span><br />
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">코드가 수정되면 위와 같이 애플리케이션 즉시 재시작됩니다.</span><br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span id="goog_2139229501"></span><a href="https://mooneegee.blogspot.kr/2017/10/python-flask-routing.html" target="_blank">Flask의 라우팅</a><span id="goog_2139229502"></span>에 대해서 살펴볼 예정입니다. Flask를 사용하여 만든 웹 애플리케이션의 URL과 함수를 연결하는 방법을 다룰 예정입니다.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-22353249018204712642017-10-09T02:46:00.000+09:002017-10-10T22:44:29.068+09:00[Python] Flask 개발 환경 설정과 설치<br />
<span id="docs-internal-guid-e9e94ca6-fd16-b095-cc8e-fe27c2840b4d"></span><br />
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span id="docs-internal-guid-e9e94ca6-fd16-b095-cc8e-fe27c2840b4d">
<span style="font-family: "consolas"; font-size: 20pt; vertical-align: baseline; white-space: pre-wrap;">전제조건</span></span></h1>
<span id="docs-internal-guid-e9e94ca6-fd16-b095-cc8e-fe27c2840b4d">
</span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-e9e94ca6-fd16-b095-cc8e-fe27c2840b4d"><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Windows 사용자는 </span><a href="https://blogs.msdn.microsoft.com/eva/?p=7633" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">이 가이드</span></a><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">에 따라 Bash를 설치하여야 합니다. 저는 Windows에서 제공하는 Linux 서브시스템을 사용하여 튜토리얼을 진행할 예정입니다. Windows 환경에서 개발하고자 한다면 구글링하여 설치하길 바랍니다. </span></span></div>
<span id="docs-internal-guid-e9e94ca6-fd16-b095-cc8e-fe27c2840b4d">
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Flask를 설치하기 위해서는 Python 2.6 혹은 그 이상 버전이 필요합니다. Flask와 Flask의 종속성이 Python 3(Python 3.3 이후 버전)에서도 잘 동작하지만, 많은 Flask extension은 Python 3을 잘 지원하지 않습니다. 그러므로 Flask는 Python 2.7 혹은 Python 3.3 이상 버전을 설치하셔야 합니다. Flask를 사용하길 원한다면 Python은 이미 설치되어 있을 것으로 예상하여 따로 다루지 않겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="font-family: "consolas"; font-size: 20pt; vertical-align: baseline; white-space: pre-wrap;">개발환경에 virtulenv 설치하기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">virtualenv</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">는 가상 Python 환경 빌더입니다. virtualenv는 다수의 Python 환경을 생성하도록 해줍니다. 그래서 라이브러리의 다른 버전 사이에서 발생할 수 있는 호환성 문제를 피할 수 있습니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">다음 명령어는 C:/pythonX/scripts 경로에 virtualenv를 설치하는 명령어입니다. 여기서 X는 Python의 버전을 나타냅니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><b>pip install virtualenv</b></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">이 명령어는 관리자 권한이 필요합니다. Linux/Mac OS에서는 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">pip</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">앞에 </span><span style="font-family: "consolas"; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">sudo</span><span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">를 추가합니다. Windows를 사용한다면 관리자 권한으로 로그인합니다. Ubuntu에서는 패키지 매니저를 virtualenv가 설치될 것입니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<b><span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">sudo apt</span><span style="color: #666600; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="color: #000088; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">get</span><span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"> install virtualenv</span></b></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">설치한 다음, 폴더는 새로운 가상환경을 설치합니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><b>mkdir newproj</b></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><b>cd newproj</b></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><b>virtualenv venv</b></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">해당 환경을 활성화하기 위해서 Linux/OS X에서는 다음 명령어를 실행합니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<b><span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">source venv</span><span style="color: #666600; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">bin</span><span style="color: #666600; font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="font-family: "consolas"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">activate</span></b></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">이제 개발 환경에 Flask를 설치할 준비가 끝났습니다.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><b>pip install Flask</b></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">이제 Flask 개발 환경 준비를 마쳤습니다. </span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="font-family: "consolas"; font-size: 20pt; vertical-align: baseline; white-space: pre-wrap;">다음에 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">설치 후에는 늘 ‘Hello World’를 먼저 출력해야 하지 않을까요? 다음에는 <a href="https://mooneegee.blogspot.com/2017/10/python-flask-hello-world.html" target="_blank">Flask 테스트 코드를 작성하고 사용</a>해 보도록 하겠습니다.</span></div>
<div>
<span style="font-family: "consolas"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</span>Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-41819895227888470712017-10-09T02:23:00.001+09:002017-10-10T22:44:18.296+09:00[Python] Flask 시작하기<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">들어가기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 서버에 대한 궁금증이 생겨서 직접 웹 애플리케이션 프레임워크를 사용하여 간단한 웹 사이트를 만들어 보면서 공부를 해볼 생각입니다. 평소 Python에 대한 관심도 있었기 때문에 Python Flask를 선택하였습니다. 먼저 다양한 튜토리얼을 참고하여 Flask와 웹 애플리케이션 프레임워크의 기능을 알아본 다음, 그 지식을 바탕으로 Bootstrap과 함께 사용하여 웹 사이트를 만드는 것이 최종 목표입니다. 상당히 긴 연재가 될 것으로 예상됩니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask에 대한 간단한 소개</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask는 Python으로 만들어진 웹 애플리케이션 프레임워크입니다. Pocco라고 이름 붙여진 열정적인 Python 사용자들의 국제적 집단을 이끄는 Armin Ronacher라는 사람이 개발하였습니다. Flask는 Werkzeug WSGI toolkit과 Jinja2 템플릿 엔진을 바탕으로 하고 있습니다. 둘 모두 Pocco 프로젝트입니다.</span></div>
<b id="docs-internal-guid-d3ab7ac8-fcfb-71e6-2ffd-8aa4ffdad9bb" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 튜토리얼은 Python의 기본 지식을 가지고 있으며 웹사이트를 만들고자 하는 사람을 대상으로 합니다. 이 튜토리얼 완료한 후, 여러분은 Flask를 사용해서 웹사이트를 개발하는 중간 수준의 기술에 도달할 것입니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 튜토리얼은 여러분이 HTML과 Python을 직접 사용해본 경험이 있다고 가정하여 진행됩니다. 만약 HTML과 Python을 다뤄본 적이 없다면 먼저 이 두 가지에 대한 간단한 튜토리얼을 먼저 해보길 바랍니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
Flask 개요</h1>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 프레임워크(Web Framework)가 무엇인가요?</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">웹 애플리케이션 프레임워크 혹은 단순하게 웹 프레임워크는 웹 애플리케이션 개발자가 프로토콜(protocol), 쓰레드(thread) 관리 등과 같은 로우레벨(low-level) 세부사항에 대해서 신경쓰지않고 애플리케이션을 만들 수 있게 해주는 라이브러리와 모듈의 모음을 말합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask가 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask는 Python</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">으로 만들어진 웹 애플리케이션 프레임워크입니다. 개발한 사람은 </span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Armin Ronacher</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">입니다. Armin Ronacher는 Pocco라는 국제적 Python 사용자 모임을 이끌고 있습니다. Flask는 Werkzeug WSGI toolkit과 Jinja2 템플릿 엔진을 바탕으로 하고 있습니다. 둘 모두 Pocco 프로젝트입니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WSGI</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Web Server Gateway Interface(WSGI)는 Python 웹 애플리케이션 개발에 있어서 표준으로 채택되었습니다. WSGI는 웹 서버와 웹 애플리케이션 사이의 보편적인 인터페이스입니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Werkzeug</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WSGI는 요청(request), 응답(response) object 그리고 다른 유틸리티 함수를 구현한 toolkit입니다. 웹 프레임워크를 WSGI 최상단에 구축할 수 있게 해줍니다. Flask 프레임워크는 Werkzeug를 바탕 중 하나로 사용합니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">jinja2 </span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">jinja2는 Python의 인기있는 templating 엔진입니다. 웹 templating 시스템은 동적인 웹 페이지를 그리기 위해서 특정 데이터 소스를 템플릿과 결합합니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flask는 종종 micro 프레임워크라고 불립니다. Flask는 애플리케이션의 핵심을 단순하지만 확장가능하게 유지하는 것이 지향합니다. Flask는 데이터베이스를 다루는 built-in 추상 레이어와 validation 지원 form을 가지고 있지 않습니다. 대신에, Flask는 애플리케이션에 함수성을 추가할 수 있도록하는 extension을 지원합니다. 몇몇 인기있는 Python extension은 나중에 다룰 예정입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다음 다룰 내용은 무엇인가요?</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://mooneegee.blogspot.com/2017/10/python-flask_9.html" target="_blank">Flask 개발 환경 설정과 설치</a>에 대해서 알아볼 예정입니다. 윈도우 사용자는 Bash도 함께 설치할 것입니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-58190437547487172492017-10-02T18:57:00.001+09:002017-10-02T19:00:02.221+09:00[IT 제품 구매 가이드] 알뜰폰 KT M 모바일 이용 후기<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span id="docs-internal-guid-92958b36-dc83-0896-5098-940d15994977" style="font-weight: normal;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">통신 서비스도 엄연히 IT 제품이라고 생각하여 작성하였습니다.</span></span></h1>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="font-family: "consolas";"><span style="font-size: 26.6667px; white-space: pre-wrap;">통신비를 줄여보자</span></span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">통신비를 획기적으로 줄여보고자 알뜬폰으로 통신사를 변경하였습니다. 통신사는 KT M 모바일입니다. 최근 가입자를 확보하기 위해서 적극적으로 프로모션을 진행하고 있습니다. 저는 올해 6월에 가입했습니다. 이 때 프로모션 사항은 평생 요금 통신요금 3000원 할인 하는 것이었습니다. 7월에는 통신요금 3000원 할인에 데이터도 추가하는 프로모션을 진행해서 7월에 가입할 걸 그랬다는 약간의 아쉬움이 남았습니다. 다른 분들은 혜택을 최대한 받으면서 가입하길 바랍니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">700MB 데이터, 음성 통화 30분을 제공하는 이 상품은 프로모션 할인을 적용하여 7000원 정도입니다. 알뜰폰 사업자가 아닌 SK, KT, LG와 비교하면 확실히 저렴합니다. 700MB 데이터는 확실히 부족하긴 합니다. 그래서 저는 KT 에그 11GB 상품을 함께 사용합니다. 모바일 데이터 대부분은 KT 에그를 사용합니다. 에그는 대량의 데이터를 저렴하게 사용할 수 있지만, 동시에 들고 다녀야 하는 기기가 하나 더 늘기 때문에 가볍게 다니기를 원하는 사람은 불편할 수 있습니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여튼 알뜰폰은 요금이 매우 합리적입니다. 대형 통신 사업자는 강제로 사용자에게 멤버십을 가입시켜 과한 요금을 지불하게 만들지만, 알뜰폰은 그런 불필요한 멤버십이 없습니다. 물론 멤버십을 적절하게 활용하는 사람도 있기도 합니다. 저는 지금까지 멤버십을 다 사용해본 경험도 없고, 멤버십 할인을 받기위해서 가맹점만 사용하는 것을 좋아하지 않기 때문에 불만이 많았습니다. 알뜰폰 사업자는 무제한 데이터 요금제를 2만원대 가격으로 제공합니다. 확실히 대형 통신 사업자가 제공하는 상품에 비하면 저렴합니다. 만약 최신 폰을 2년 혹은 3년 약정을 걸어서 구매하는 사용자가 아니라면 알뜰폰은 현명한 선택지가 될 것입니다. 앞으로 휴대전화를 완전 자급제로 이용하는 방식으로 바뀔 것입니다. 직접 휴대전화를 구매해서 사용하는 직구족들에게 알뜰폰은 통신 요금을 절약할 수 있는 좋은 방법입니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">지금까지는 알뜰폰의 최대 장점인 가격을 위주로 말씀드렸습니다. 하지만 저는 오늘 KT M 모바일과 같은 알뜰폰의 장점만 말하려고 하는 것은 아닙니다. 저렴한만큼 사용자가 대형 통신 사업자가 제공하는 편의 서비스를 쉽게 받을 수 없는 등의 단점이 있습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">KT M 모바일의 불편한 점</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">본격적으로 KT M 모바일을 사용하면서 느꼈던 불편함을 언급해보고자 합니다. 자세히 말씀드리기 전에 여기서 지적하는 문제점은 모두 고객센터를 통해서 해결하였다는 점을 먼저 알려 드립니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이벤트 적용이 되지 않는다?</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저는 KT M 모바일의 6월 이벤트가 제공하는 혜택때문에 가입하였습니다. 가입비 및 USIM가 무료이고, 평생 요금이 3000원 할인되는 혜택입니다. 즐거운 마음으로 가입하였고 매달 7000원으로 통신 서비스를 이용할 수 있다고 생각했습니다. 너무 저렴한 요금이기도 했고, 카드로 자동납부 했기 때문에 신경쓰지 않았습니다. 약 3달 이용한 후 요금 납부를 확인한 결과 좀 놀라운 사실을 발견하였습니다. 당연히 처리될 것이라고 생각하였던 할인 이벤트가 적용되지 않은 상태로 납부되고 있었습니다. 혹시 내가 잘못 가입하였거나, 데이터 혹은 통화 요금이 추가되었는지 확인하였습니다. 추가로 부과될 요금은 없다는 사실을 확인하였고, 결국 고객센터로 연락하였습니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">고객센터에 저의 상황을 알려드렸습니다. 상담원은 친절하게 응대해주었기 때문에 불편함 없이 불만사항을 접수할 수 있었습니다. 그런데 의아한 점은 저는 6월에 가입하였는데, 고객센터에서는 제가 이벤트 적용 대상자인지 다시 확인해야 한다고 하였습니다. 이벤트 기간에 가입한 사람을 일괄 적용하지 않는 것일지도 모른다는 생각이 들었습니다. 아마 프로모션을 통해서 KT M 모바일에 가입하신 분이라면 자신이 제대로 프로모션을 받고 있는지 확인할 필요가 있습니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">고객센터에서는 정상적으로 적용되지 않았던 프로모션 할인 혜택을 다음달 요금에 일괄 적용한다고 알려주었습니다. 고객센터에서 확인한만큼 다음 요금은 할인될 것으로 믿고 있습니다. 다만 사용자가 요금할인과 같은 민감한 사항이 제대로 처리되지 않았기때문에 아직 서비스 품질이 좋다고 평가하기는 힘들다는 생각이 들었습니다.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USIM 등록</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USIM카드를 수령하고 특별한 문제없이 사용하고 있었습니다. 요즘 많은 사람들에게 관심을 받고 있는 카카오 뱅크를 저도 한번 사용해보고 싶어졌습니다. 저는 평소 우리은행, 국민은행, 신한은행 등의 앱이 너무 불편하다고 생각하였습니다. 은행 앱의 주된 기능은 조회와 이체지만, 이 앱은 불필요한 기능을 집어넣었기 때문에 접근성이 너무나도 떨어지기 때문이라 최악입니다. 카카오 페이와 같은 간편 결제를 사용하면서 이런 생각은 더욱 강해졌습니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">카카오 뱅크를 가입하기 위해서 계좌를 생성하는 중에 문제가 발생하였습니다. 전에는 몰랐는데 기기에 저의 전화번호가 저장되어 있지 않기 때문에 인증할 수 없다는 사실을 처음 알게 되었습니다. ‘설정 > 네트워크 상태’에 제 전화번호를 표시되지 않았습니다. 구글링을 한 결과, 고객센터를 통해서 USIM을 등록하면 기기에 저의 전화번호가 정상으로 등록된다는 사실을 알게 되었습니다. 이때까지 저에게 오는 전화도 문제없이 받을 수 있었고, 제가 다른 이에게 전화를 걸 때도 문제가 전혀 없었습니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">고객센터에 저의 상황을 말하니 간단하고 빠르게 처리해주었습니다. 기존 대형 통신 사업자를 이용할때는 경험해보지 못한 문제라서 언급하였습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">그래도 사용할만하다</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저는 앞에 언급한 두가지 문제를 겪었지만 당분간은 KT M 모바일을 사용할 계획입니다. 기간 약정이 없기 언제든지 통신사를 변경할 수도 있기 때문입니다. 통화 품질과 같은 문제는 모두가 알듯이 거의 문제가 없었습니다. 고객센터도 이전에 비해서 연결되는데 소모되는 시간이 많이 감소하였습니다. 사소한 서비스는 아직은 대형 통신사를 완전히 따라가기는 힘들지는 몰라도 스스로 꼼꼼하게 확인하고 혜택을 챙길 수 있는 사용자라면 알뜰폰은 좋은 대안이 될 수 있습니다.</span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0tag:blogger.com,1999:blog-8901079106297905449.post-30215668268737332712017-09-27T22:10:00.001+09:002018-01-06T23:39:01.709+09:00[IT 제품 구매 가이드] OLKB Planck 키보드 - 키맵핑 수정하기(QMK 펌웨어)<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 글은 QMK 펌웨어를 사용하는 키보드의 키 맵핑을 간단한 프로그래밍을 통해서 수정하는 방법을 설명합니다. QMK 펌웨어를 사용하는 키보드 목록은 여기에서 확인할 수 있습니다. 키보드 제조사에서 공식적으로 펌웨어를 업데이트하는 키보드 목록은 다음과 같습니다.</span></div>
<b id="docs-internal-guid-07b90c86-c373-c39d-032e-c012bdd1eb9a" style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OLKB Planck, Preonic, Atomic</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ErgoDox EZ</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Clueboard, Cluecard, Cluepad</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 밖에서 우리나라에서도 많이 사용하는 키보드인 Happy Hacking 키보드도 제조사에서 직접 관리하는 것은 아니지만 QMK 커뮤니티에서 관리하는 것으로 알고 있습니다. 다수의 프로그래밍 가능한 키보드가 QMK 펌웨어를 사용하고 있으므로 참고하셔도 좋습니다. 프로그래밍 가능한 키보드를 선택한 사용자는 아마도 프로그래밍을 할 수 있을 것으로 예상되지만, 이 글은 그렇지 않은 사람들도 쉽게 따라할 수 있도록 작성하겠습니다. 프로그래밍과 관련된 설명을 하는 것이 아니라 자신의 원하는 키 맵핑을 작성하여 키보드에 적용하는 방법을 단계별로 구분하여 설명하겠습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Windows 10에서 리눅스 서브 시스템 추가</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">여기 관련된 좋은 자료는 많기 때문에 </span><a href="https://blogs.msdn.microsoft.com/eva/?p=7633" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">링크</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">로 대신 하겠습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">리눅스 서브 시스템을 추가하고, 계정 및 비밀번호까지 설정하면 끝입니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GitHub를 사용하여 qmk_firmware Fork하기</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">링크를 누르면 과정별로 자세한 설명이 되어 있으므로 참고하시길 바랍니다.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://git-scm.com/book/ko/v2/GitHub-%EA%B3%84%EC%A0%95-%EB%A7%8C%EB%93%A4%EA%B3%A0-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">GitHub 계정을 생성</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">한 후, 로그인합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://github.com/qmk/qmk_firmware" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">QMK Firmware 공식 GitHub</span></a><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 Fork합니다.</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="404" src="https://lh6.googleusercontent.com/q6tMsnW4joOy1WovtYx7IxCFYCj55pmXlfGDSwupFlqjk-EGzNWrDF_ZJreAKihe_mGaahbhxhAqWmbc77glNfPoh1EUq-YiLQATNLSoFq7AGf2gn-5YmH6a8RQYg_IKbIzny6vF" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이미지의 오른쪽 구석에 빨간 동그라미로 되어 있는 버튼을 누르면 됩니다.</span></div>
<ol start="3" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다시 GitHub로 홈으로 우측을 보면 방금 Fork한 QMK Firmware를 확인할 수 있습니다.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="492" src="https://lh3.googleusercontent.com/-gXs6kJB3oZ5esDFKhVOUsmb9N2vTDEXy1_uSW8Zh6K9sBrVP7fAL-pu9k2QMembkVX8V2V5g3VVWSoGem5aYoJW6vJ9cN3L9w204CuEQfX70Bp4WeDi7Frm6MyRrgHMOGgjtk-k" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
</div>
<ol start="4" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">qmk_firmware를 클릭하면 Fork한 곳으로 이동합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이동한 후, 웹 브라우저 주소창의 주소를 복사합니다.</span></div>
</li>
</ol>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bash를 사용하여 GMK Firmware Clone하기</span></h1>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">윈도우키를 누르고, ‘cmd’를 입력하여 Command Prompt를 켭니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">‘bash’라고 명령어를 입력하면 Bash가 실행됩니다.</span></div>
</li>
</ol>
<ol start="3" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">자신이 원하는 곳으로 이동합니다. 저는 ‘Documenta’ 디렉토리에 설치하도록 하겠습니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cd Documents/ 를 입력합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">정상적으로 이동되었다면 ‘</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/mnt/c 혹은 d와 같은 디스크 이름/계정명/Documents</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">’입니다. </span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Clone에 필요한 다양한 라이브러리를 설치합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-get update</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 두 명령어를 복사해서 차례대로 각각 실행합니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">디렉토리가 변경되면 우리가 Fork한 QMK Firmware을 Clone합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">git clone --recurse-submodules [Fork했던 주소](괄호는 넣지 않습니다.)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">clone이 완료되면 qmk_firmware 디렉토리가 생성되고, 필요한 파일들이 다운로드되어 있다는 것을 확인할 수 있습니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">qmk_firmware 디렉토리로 이동합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cd qmk_firmware/</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">펌 웨어 작성에 필요한 도구를 설정합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">util/wsl_install.sh</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">설치 과정 중에 설정을 적당하게 해주면 됩니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 과정에 설치되는 Flip은 나중에 펌 웨어를 Flashing하는 프로그램입니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">펌 웨어 작성 준비는 모두 끝났습니다.</span></div>
</li>
</ol>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">자신만의 키맵 작성하기</span></h1>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">‘</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">자신이 설치한 경로\qmk_firmware\keyboards\planck\keymaps\</span><span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">’로 이동합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default 폴더를 복사해서 그대로 붙여넣은 다음, 디렉토리명을 자신이 원하는대로 변경합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">붙여넣은 폴더로 이동해서 ‘keymap.c’ 파일을 엽니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">자신이 원하는대로 키맵핑을 수정합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">수정할 부분은 [_QWERTY], [_LOWER], [_RAISE]입니다.</span></div>
</li>
</ol>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="280" src="https://lh6.googleusercontent.com/uMtpKFgNnWW2FOgMADQADfxIJTGkN9VqNiBeow5NdZ_NUN2vQKMmyMGsVRBGBvnJjOJQogjNsBdJ8w3tdiD-uOghXArdVsNr--wqRAIof9PIT5F2x7Om1M9B8YCKeV3dQxROuuRI" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="241" src="https://lh4.googleusercontent.com/IEDiD9iYrU9z5g3Iv8tYFIPSfFEvwp312fND5WRLJ6alaOZTcXAGrGBfiX7u_CY5_41kBZDBzGC-l4e5G2cKqE4w6YxOOQnGVSstZ8Ix5gWuplPVComBxUneii0VxiO72F_6d69c" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="244" src="https://lh5.googleusercontent.com/TY_JOuGF0tSEDk17hzvTksjVxxlaNDgEOlyHjIo2rJJPjMPsWH7BEJKd5kK1g4hEOojR9LhrRXwnzv_mW5IYh9ukfJ6Y3R2t5VqACzIOIUV3bD0IRDkEMDPU6bstpVyNxHIYje2O" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ol start="5" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이미지에서 볼 수 있듯이 녹색 글자 부분과 흰색 글자 부분은 정확히 맵핑되어 있습니다. 녹색 부분은 수정하지 않아도 문제는 없지만, 키맵핑을 수정할 때, 헷갈리지 않도록 녹색 글자 부분도 수정하고 흰색 글자 부분도 수정하고 저장합니다.</span></div>
</li>
</ol>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">펌웨어 빌드하고, Flashing하기</span></h1>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">다시 qmk_firmware의 디렉토리로 이동합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">make planck-rev4-[자신이 정했던 디렉토리명] (괄호는 생략합니다.)</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 명령어로 키보드의 빌드 파일인 planck_rev4_자신이 정했던 디렉토리명].hex 파일이 생성됩니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Filp을 실행합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Device > select > ATmega32U4를 선택합니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Planck 키보드는 아래쪽의 리셋 버튼을 누릅니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USB 모양 버튼을 누르고, USB를 선택합니다. 그리고 OPEN을 선택합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키보드가 리셋이 된 상태가 아니면 USB 연결이 되지 않습니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">연결이 되지 않았다면 다시 키보드 리셋 버튼을 눌러줍니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">File > Load HEX File을 선택합니다.</span></div>
</li>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">qmk_firmware/.build/ 디렉토리를 선택합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">make 명령어로 만든 planck_rev4_[자신이 정했던 디렉토리명].hex 파일을 선택합니다.</span></div>
</li>
</ol>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Run 버튼을 누릅니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">성공하였다면 Start Application을 누릅니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">키보드가 다시 실행되고 수정한 키 맵핑이 적용되어 있을 것입니다.</span></div>
</li>
</ol>
<div>
<span style="font-family: "consolas";"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: "consolas";"><span style="font-size: 14.6667px; white-space: pre-wrap;">공식 메뉴얼은 <a href="https://docs.qmk.fm/getting_started_build_tools.html" target="_blank">여기</a>에서 볼 수 있습니다.</span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "consolas"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com12tag:blogger.com,1999:blog-8901079106297905449.post-11479519370080345462017-09-26T14:52:00.003+09:002017-10-21T04:01:20.086+09:00[IT 제품 구매 가이드] Cherry MX Ergo Clear<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">전에 </span><a href="https://mooneegee.blogspot.kr/2017/09/it-cherry-mx.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Cherry MX 스위치</span></a><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">를 설명하는 포스팅을 한 적이 있습니다. 스위치 힘 곡선을 보면서 Cherry의 대표적인 스위치 몇몇의 특징에 대해서 간단히 설명하였던 글이었습니다. 그 글 마지막 부분에 저는 Cherry MX Brown 스위치의 가벼움과 Cherry MX Clear 스위치의 뚜렷한 구분감을 동시에 느끼고 싶다고 언급하였습니다. 그래서 Brown 스위치의 스프링을 Clear 스위치의 스프링과 교체하고자 했습니다. 구글링을 해본 결과, ‘Cherry MX Ergo Clear’라는 이름으로 이미 많은 사람들이 사용하고 있는 키 스위치 커스터마이징 방법이었습니다. 평도 좋아서 저도 한번 시도해보고자 합니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 20pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Ergo Clear 스위치와 스프링</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 스위치는 Cherry MX Clear 스위치에 Cherry MX Red, Brown, Blue에 사용되는 가벼운 스프링을 적용한 커스터마이징 스위치입니다. 처음에는 Cherry MX Black 스위치의 스프링을 사용했다고 합니다. Black 스위치의 스프링은 Clear 스위치보다 살짝 가볍긴 하지만 Cherry MX Red 등에 사용되는 가벼운 스프링에 비교하면 무겁기는 마찬가지입니다. 여기서 ‘가볍다’ 혹은 ‘무겁다’라는 표현은 스프링의 탄성을 의미합니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">아래의 표는 스프링의 얼마나 가벼운지 혹은 무거운지를 실측한 자료입니다. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Light는 Cherry MX Red, Brown, Blue에 사용되는 스프링을 의미합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Heavy는 Cherry MX Black, Green, White에 사용되는 스프링을 의미합니다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Originative는 모두 우리나라에서 판매하는 스프링을 의미합니다.</span></div>
</li>
</ul>
<b id="docs-internal-guid-1aef924e-bcb7-6328-01a8-8c491a6b7ea0" style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="75"></col><col width="45"></col><col width="47"></col><col width="45"></col><col width="47"></col><col width="45"></col><col width="47"></col><col width="45"></col><col width="47"></col><col width="45"></col><col width="47"></col><col width="45"></col><col width="47"></col></colgroup><tbody>
<tr style="height: 40pt;"><td style="background-color: white; border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><br /></td><td colspan="2" style="background-color: white; border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Light</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Heavy</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Clear</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Originative 45g</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Originative 55g</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Originative 62g</span></div>
</td></tr>
<tr style="height: 28pt;"><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Position:</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Up</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Down</span></div>
</td></tr>
<tr style="height: 28pt;"><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Average:</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">35.2</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">63.4</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">45.7</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">87.8</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">40.6</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">89.9</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">25.8</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">56.3</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">32.2</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">59.2</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">35.5</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">66.7</span></div>
</td></tr>
<tr style="height: 28pt;"><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Variance:</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.99</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.59</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1.03</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2.46</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2.22</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.14</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.49</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.08</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.37</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1.12</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1.05</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1.12</span></div>
</td></tr>
<tr style="height: 28pt;"><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Error:</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5.6%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6.0%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3.4%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3.7%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5.3%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5.7%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6.9%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6.0%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.5%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5.0%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6.9%</span></div>
</td><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3.7%</span></div>
</td></tr>
<tr style="height: 28pt;"><td style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">k(g/mm):</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7.43</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">11.08</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">12.96</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8.03</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7.08</span></div>
</td><td colspan="2" style="border-bottom: solid #808080 0.75pt; border-left: solid #808080 0.75pt; border-right: solid #808080 0.75pt; border-top: solid #808080 0.75pt; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8.21</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: center;">
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;"><a href="https://geekhack.org/index.php?topic=46449.0" target="_blank">스프링 측정 자료</a></span></span></div>
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">실측 자료이지만 샘플 갯수가 많지는 않은 자료라는 점을 알려드립니다. 주목할만한 점은 Cherry MX Heavy와 Clear는 압도적인 무거움을 보여준다는 것입니다. 저도 일주일 동안 Clear 스위치를 사용해본 결과, 너무 피곤해서 오래 사용하기는 힘들다고 느꼈습니다.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">이 두 스프링을 제외하면 취향에 맞게 선택하면 될 것 같습니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 20pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">준비물</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">준비물은 다음과 같습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Clear 스위치</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cherry MX Brown 스위치 혹은 이 스위치에 사용된 것과 동일한 스프링</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치를 분해할 간단한 도구</span></div>
</li>
</ul>
<div>
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">가장 중요한 준비물은 바로 Cherry MX Clear 스위치입니다. 이 스위치는 </span><a href="http://winkeyless.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://winkeyless.com/</span></a><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">에서 구매할 수 있습니다. 그 다음 필요한 것은 스프링입니다. 저는 예전부터 써왔지만 지금은 사용하지 않는 Brown 스위치 키보드가 있었기 때문에 스프링을 별도로 구매하지 않고 Brown 스위치의 것을 뽑아서 사용하였습니다. 마지막으로 스위치를 분해할 간단한 도구가 필요합니다. 처음 스위치를 분해한다고 그러면 뭔가 어려운 작업 같은 선입견이 들지만, 사실 Cherry MX 스위치는 간단한 구조로 몇 안되는 부품을 사용하기 때문에 전혀 어렵지 않게 분해할 수 있습니다. 다만 좀더 편하게 분해할 수 있는 좋은 방법을 미리 알고 있으면 작업은 훨씬 수월해집니다.</span></div>
<b style="font-weight: normal;"><br />
</b> <br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="468" src="https://lh3.googleusercontent.com/ApeVpzr5ghmqVgJviXDHjj8wp81azUydkb1rUeFe9T0C2z5ch2GnaDeTOt8hwDiT8MYcxBDw_vHdmp8DfBs8Bitf-jmUs214i6vGNKpEc93Yc4937PHimSoCxdsM3Dx1t_ZCqB8E" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: #1155cc; font-family: "arial"; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"><a href="https://www.mechanical-keyboard.org/advantages-and-disadvantages-of-mechanical-keyboards/" style="text-decoration: none;">Brown 스위치를 구성하고 있는 부품</a></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br />
<div dir="ltr" style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<br />
<h1 dir="ltr" style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 20pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">스위치 분해 및 재조립</span></h1>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/PdE_HGM3zrE" width="560"></iframe><br /></div>
<div style="text-align: center;">
<span style="color: black; font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">쉽게 스위치를 분해할 수 있는 방법을 알려주는 영상</span></div>
<div>
<br /></div>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">준비물을 갖추고 스위치 분해 방법도 알았다면 끝난 것과 마찬가지 입니다. Clear 스위치의 스프링을 Brown 스위치의 스프링으로 교체해준 다음, 원래대로 다시 조립만 해주면 됩니다. 축을 스프링에 얹고 스위치 덮개로 스위치를 결합해주면 끝납니다. 결합 과정을 참고하실 분은 아래의 영상을 참고하시면 됩니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<br />
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/95oZ5QPTDuc" width="560"></iframe><br /></div>
<div style="text-align: center;">
스위치 분해 후 재조립 영상</div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial"; font-size: 11pt; white-space: pre-wrap;">작업이 끝났습니다. 이제 사용하기만 하면 됩니다. Clear 스위치에 비해서 얼마나 가벼워졌는지, Brown 스위치에 비해서 얼마나 입력 피드백이 뚜렷한지를 살펴보면 됩니다.</span></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 20pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 20pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">사용 후 느낌</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">개인적으로 처음 시도해보는 스위치 분해이고 커스터마이징이었습니다. 저는 집에 있는 작은 일자 드라이버 두 개로 조금은 불편하게 분해하였지만 그리 어렵지도 않았습니다. 쉽게 작업을 완료한 것에 비교했을때, 결과는 매우 만족스럽습니다. 제가 느낀 Ergo Clear 스위치의 장점은 다음과 같습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">기존 Clear 스위치보다 가볍게 누를 수 있기 때문에 장시간 타자를 쳐도 손가락이 피곤하지 않다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Brown 스위치보다 돌기에 걸리는 구간도 길고 크기때문에 입력 피드백이 뚜렷하게 느껴진다.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">저처럼 Brown 스위치가 조금 심심하다고 느껴지는 분들은 한번 시도해볼만 합니다. 다만 대부분의 제조사에서 Clear 스위치를 잘 채택하지 않기 때문에 스위치를 추가로 구매할 경우에 약간의 지출은 어쩔 수 없습니다. 모든 스위치를 교체하는 것이 부담이 된다면 알파벳 부분의 스위치만 교체하는 것도 좋은 방법입니다.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">하지만 Brown 스위치의 부드러움을 좋아하시는 분들에게는 추천하지 않습니다. 스위치의 부드러움보다는 Clear 스위치의 축을 그대로 사용하기 때문에 부드러움보다는 확실한 입력 피드백이 장점인 스위치입니다. 부드러움을 선호하시는 분은 Ergo Clear는 도로의 과속 방지턱이 주는 답답함으로 느껴질 수 있습니다.</span><br />
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="font-family: arial;"><span style="font-size: 14.6667px; white-space: pre-wrap;">스위치 커스텀에 중요한 요소 중에 하나인 스프링에 대한 좀더 자세한 내용은 <a href="http://%EC%82%AC%EC%9A%A9%20%ED%9B%84%20%EB%8A%90%EB%82%8C%20%EA%B0%9C%EC%9D%B8%EC%A0%81%EC%9C%BC%EB%A1%9C%20%EC%B2%98%EC%9D%8C%20%EC%8B%9C%EB%8F%84%ED%95%B4%EB%B3%B4%EB%8A%94%20%EC%8A%A4%EC%9C%84%EC%B9%98%20%EB%B6%84%ED%95%B4%EC%9D%B4%EA%B3%A0%20%EC%BB%A4%EC%8A%A4%ED%84%B0%EB%A7%88%EC%9D%B4%EC%A7%95%EC%9D%B4%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%A0%80%EB%8A%94%20%EC%A7%91%EC%97%90%20%EC%9E%88%EB%8A%94%20%EC%9E%91%EC%9D%80%20%EC%9D%BC%EC%9E%90%20%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84%20%EB%91%90%20%EA%B0%9C%EB%A1%9C%20%EC%A1%B0%EA%B8%88%EC%9D%80%20%EB%B6%88%ED%8E%B8%ED%95%98%EA%B2%8C%20%EB%B6%84%ED%95%B4%ED%95%98%EC%98%80%EC%A7%80%EB%A7%8C%20%EA%B7%B8%EB%A6%AC%20%EC%96%B4%EB%A0%B5%EC%A7%80%EB%8F%84%20%EC%95%8A%EC%95%98%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%89%BD%EA%B2%8C%20%EC%9E%91%EC%97%85%EC%9D%84%20%EC%99%84%EB%A3%8C%ED%95%9C%20%EA%B2%83%EC%97%90%20%EB%B9%84%EA%B5%90%ED%96%88%EC%9D%84%EB%95%8C,%20%EA%B2%B0%EA%B3%BC%EB%8A%94%20%EB%A7%A4%EC%9A%B0%20%EB%A7%8C%EC%A1%B1%EC%8A%A4%EB%9F%BD%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%A0%9C%EA%B0%80%20%EB%8A%90%EB%82%80%20Ergo%20Clear%20%EC%8A%A4%EC%9C%84%EC%B9%98%EC%9D%98%20%EC%9E%A5%EC%A0%90%EC%9D%80%20%EB%8B%A4%EC%9D%8C%EA%B3%BC%20%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4./">여기</a>에 정리해두었습니다.</span></span></div>
Anonymoushttp://www.blogger.com/profile/07920053784429544408noreply@blogger.com0