{"id":10669,"date":"2014-08-14T16:33:00","date_gmt":"2014-08-14T16:33:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=10669"},"modified":"2014-08-14T16:33:00","modified_gmt":"2014-08-14T16:33:00","slug":"%ed%8c%8c%ec%9d%bc-%ec%97%ac%eb%9f%ac%ea%b0%9c-%ea%b3%a8%eb%9d%bc%ec%84%9c-%ec%b2%98%eb%a6%ac%ed%95%98%eb%8a%94-%ed%8c%8c%ec%9d%b4%ec%8d%ac-%ed%85%9c%ed%94%8c%eb%a6%bf","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=10669","title":{"rendered":"\ud30c\uc77c \uc5ec\ub7ec\uac1c \uace8\ub77c\uc11c \ucc98\ub9ac\ud558\ub294 \ud30c\uc774\uc36c \ud15c\ud50c\ub9bf"},"content":{"rendered":"<div class=\"desc\">\n<div class=\"tt_article_useless_p_margin\">\n<div class=\"txc-textbox\" style=\"BORDER-TOP: rgb(231,253,181) 1px solid; BORDER-RIGHT: rgb(231,253,181) 1px solid; BORDER-BOTTOM: rgb(231,253,181) 1px solid; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 10px; BORDER-LEFT: rgb(231,253,181) 1px solid; PADDING-RIGHT: 10px; BACKGROUND-COLOR: rgb(231,253,181)\">\n<p>\n           # -*- coding: utf-8 -*-<br \/>\n           <br \/>\n           import wx<br \/>\n           <br \/>\n           import os<br \/>\n           <br \/>\n           import sys<br \/>\n           <br \/>\n           reload(sys)<br \/>\n           <br \/>\n           sys.setdefaultencoding(&#8216;cp949&#8217;)<\/p>\n<p>           def converting(f):<br \/>\n           <br \/>\n           tar=open(f[:-4]+&#8221;_processed.txt&#8221;, &#8220;w&#8221;)<br \/>\n           <br \/>\n           src=open(f, &#8220;r&#8221;)<br \/>\n           <br \/>\n           src.readline()<br \/>\n           <br \/>\n           src.readline()<br \/>\n           <br \/>\n           src.readline()<br \/>\n           <br \/>\n           while True:<br \/>\n           <br \/>\n           d=src.readline()<br \/>\n           <br \/>\n           if d[0]==&#8221;\\&#8221;&#8221;:<br \/>\n           <br \/>\n           break<br \/>\n           <br \/>\n           d=d.replace(&#8220;,&#8221;,&#8221;\\t&#8221;)<br \/>\n           <br \/>\n           tar.writelines([d])<br \/>\n           <br \/>\n           tar.flush()<br \/>\n           <br \/>\n           tar.close()<br \/>\n           <br \/>\n           src.flush()<br \/>\n           <br \/>\n           src.close()<\/p>\n<p>           class mainframe(wx.Frame):<br \/>\n           <br \/>\n           def __init__(self, *args, **kwds):<br \/>\n           <br \/>\n           kwds[&#8220;style&#8221;] = wx.DEFAULT_FRAME_STYLE<br \/>\n           <br \/>\n           wx.Frame.__init__(self, *args, **kwds)<br \/>\n           <br \/>\n           dig = wx.FileDialog(None, message=&#8221;Choose data files&#8221;, style = wx.FD_MULTIPLE)<br \/>\n           <br \/>\n           if dig.ShowModal() == wx.ID_OK:<br \/>\n           <br \/>\n           for fn in dig.GetPaths():<br \/>\n           <br \/>\n           converting(fn)<\/p>\n<p>           class conv(wx.App):<br \/>\n           <br \/>\n           def OnInit(self):<br \/>\n           <br \/>\n           wx.InitAllImageHandlers()<br \/>\n           <br \/>\n           main = mainframe(None, -1, &#8220;&#8221;)<br \/>\n           <br \/>\n           self.SetTopWindow(main)<br \/>\n           <br \/>\n           main.Show(True)<br \/>\n           <br \/>\n           main.Show(False)<br \/>\n           <br \/>\n           exit()<br \/>\n           <br \/>\n           return 1<\/p>\n<p>           if __name__ == &#8220;__main__&#8221;:<br \/>\n           <br \/>\n           conv = conv(0)<br \/>\n           <br \/>\n           conv.MainLoop()<br \/>\n           \n<\/p>\n<\/div>\n<p>\n\n<\/p>\n<p>\n          wxPython\uc744 \uc774\uc6a9\ud55c \ud504\ub85c\uadf8\ub7a8\uc774\ub2e4. \ub300\ucda9 \ubd84\uc11d\ud574 \ubcf4\uba74 \uc54c\uaca0\uc9c0\ub9cc, sys.setdefaultencoding\uc5d0 cp949\ub97c \uc4f4\uac83\uc740 \uc708\ub3c4\uc6b0 \uc804\uc6a9\uc774\ub77c\ub294 \ub73b\uc774\uace0 \ub9ac\ub205\uc2a4\ub098 \ub9e5\uc5d0\uc11c\ub294 \ud544\uc694 \uc5c6\ub2e4.(\uc548\uc4f0\uba74 \ub41c\ub2e4.)\n         <\/p>\n<p>\n          converting(f)\uc5d0 \ud30c\uc77c\uc744 \ud558\ub098\uc529 \ubc1b\uc544\uc11c \ucc98\ub9ac\ud558\ub294 \ud568\uc218\ub97c \uad6c\ud604\ud558\uba74 \ub41c\ub2e4. \ud30c\uc77c \ubaa9\ub85d\uc744 \ubc1b\uc544\uc11c \ud558\ub098\uc529 \uc9d1\uc5b4\ub123\uc5b4\uc8fc\ub294 \ubc18\ubcf5\ubb38\uc740 mainframe\uc548\uc5d0 for fn in dig.GetPaths()\uc774\ub2e4.\n         <\/p>\n<\/p>\n<p>\n          \ud30c\uc77c \ud558\ub098\uc529\uc740 \ucc98\ub9ac\ud558\uaca0\ub294\ub370 \uc218\ubc31\uac1c \ucc98\ub9ac\ub97c \uc790\ub3d9\ud654 \uc2dc\ucf1c\uc57c \ud560 \ub54c \uc4f0\uba74 \uc88b\uc740 \ud15c\ud50c\ub9bf\uc774\ub2e4. \uc9c1\uc811 \ub9cc\ub4e4\uc5c8\uc74c.\n         <\/p>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=3512\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p># -*- coding: utf-8 -*- import wx import os import sys reload(sys) sys.setdefaultencoding(&#8216;cp949&#8217;) def converting(f): tar=open(f[:-4]+&#8221;_processed.txt&#8221;, &#8220;w&#8221;) src=open(f, &#8220;r&#8221;) src.readline() src.readline() src.readline() while True: d=src.readline() if d[0]==&#8221;\\&#8221;&#8221;: break d=d.replace(&#8220;,&#8221;,&#8221;\\t&#8221;) tar.writelines([d]) tar.flush() tar.close() src.flush() src.close() class mainframe(wx.Frame): def __init__(self, *args, **kwds): kwds[&#8220;style&#8221;] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) dig = wx.FileDialog(None, message=&#8221;Choose data files&#8221;, style = wx.FD_MULTIPLE) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-10669","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-2M5","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/10669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10669"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/10669\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10669"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}