{"id":27,"date":"2008-10-13T05:33:00","date_gmt":"2008-10-13T05:33:00","guid":{"rendered":"http:\/\/www.binarytides.com\/blog\/?p=27"},"modified":"2020-07-31T09:56:59","modified_gmt":"2020-07-31T04:26:59","slug":"wxpython-stderr-stdout-window","status":"publish","type":"post","link":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/","title":{"rendered":"wxPython &#8211; How to Display stderr stdout window"},"content":{"rendered":"<h3>wxpython<\/h3>\n<p>While executing a wxpython script if a error occurs then a white window popups with some message, and it disappears fast enough before it can be read.<\/p>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n\n<!-- BinaryTides_S2S_InContent_ROS_Pos1 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1611170977806-3_123456\"><\/div>\n\n\n<\/div>\n<!-- Time: 1.1920928955078E-5, Pos: 175, Key: ad_unit_1 -->\n\n\n<p>So here is a fix to pause it and read it what and where the error in the code is : <\/p>\n<pre class=\"source-code\" >app = wx.App(redirect=False)\r\nMyFrame(None).Show()\r\napp.MainLoop()<\/pre>\n<p>The wx.App takes this parameter called redirect which can be True or False.<\/p>\n<p>It defaults to True for Windows and MacOS. Another argument is  filename=(None\/<name>) which defaults to None. So, if redirect is True, stdout\/stderr stuff goes either to a file or to the window and this window stay for a split of a second and disappears. <\/p>\n<p>Setting the redirect argument to False makes the window stay or the output goes to console depending on whether the python file is run from console or scite text editor.<\/p>\n\n<!-- SMARTADDR: No ad unit (ad_unit_2) was added at location: 3675. Content Length: 1489 -->\n<!-- SMARTADDR: No ad unit (ad_unit_3) was added at location: 3675. Content Length: 1582 -->\n<!-- SMARTADDR: No ad unit (ad_unit_4) was added at location: 3675. Content Length: 1675 -->\n<!-- SMARTADDR: No ad unit (ad_unit_5) was added at location: 3675. Content Length: 1768 -->","protected":false},"excerpt":{"rendered":"<p>wxpython While executing a wxpython script if a error occurs then a white window popups with some message, and it disappears fast enough before it can be read. So here is a fix to pause it and read it what and where the error in the code is : app = wx.App(redirect=False) MyFrame(None).Show() app.MainLoop() The&#8230; <span class=\"read-more\"><a href=\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":15958,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[541],"tags":[50,677],"class_list":["post-27","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-python","tag-wxwidgets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>wxPython - How to Display stderr stdout window - BinaryTides<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Silver Moon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/\",\"url\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/\",\"name\":\"wxPython - How to Display stderr stdout window - BinaryTides\",\"isPartOf\":{\"@id\":\"https:\/\/www.binarytides.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg\",\"datePublished\":\"2008-10-13T05:33:00+00:00\",\"dateModified\":\"2020-07-31T04:26:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage\",\"url\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg\",\"contentUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.binarytides.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"wxPython &#8211; How to Display stderr stdout window\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.binarytides.com\/#website\",\"url\":\"https:\/\/www.binarytides.com\/\",\"name\":\"BinaryTides\",\"description\":\"News, Technology, Entertainment and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.binarytides.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\",\"name\":\"Silver Moon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"caption\":\"Silver Moon\"},\"description\":\"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.\",\"url\":\"https:\/\/www.binarytides.com\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"wxPython - How to Display stderr stdout window - BinaryTides","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/","twitter_misc":{"Written by":"Silver Moon","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/","url":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/","name":"wxPython - How to Display stderr stdout window - BinaryTides","isPartOf":{"@id":"https:\/\/www.binarytides.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage"},"image":{"@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage"},"thumbnailUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg","datePublished":"2008-10-13T05:33:00+00:00","dateModified":"2020-07-31T04:26:59+00:00","author":{"@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd"},"breadcrumb":{"@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#primaryimage","url":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg","contentUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2023\/09\/no-thumbnail.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/www.binarytides.com\/wxpython-stderr-stdout-window\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.binarytides.com\/"},{"@type":"ListItem","position":2,"name":"wxPython &#8211; How to Display stderr stdout window"}]},{"@type":"WebSite","@id":"https:\/\/www.binarytides.com\/#website","url":"https:\/\/www.binarytides.com\/","name":"BinaryTides","description":"News, Technology, Entertainment and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.binarytides.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd","name":"Silver Moon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","caption":"Silver Moon"},"description":"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.","url":"https:\/\/www.binarytides.com\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":1,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":10536,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/27\/revisions\/10536"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media\/15958"}],"wp:attachment":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}