{"id":190924,"date":"2013-08-21T17:22:03","date_gmt":"2013-08-21T13:22:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=190924"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=190924","title":{"rendered":"<span class=\"post_title\">ExConsole \u2014 \u044d\u043a\u0441\u0442\u0440\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043b\u044f Python<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u0441\u0442 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u0435\u0440\u0445\u043a\u0440\u0430\u0442\u043a\u0438\u043c.<\/p>\n<p>  <b>ExConsole<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c-\u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u0432 Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043b\u0438\u0431\u043e \u043f\u043e \u043f\u0440\u0438\u0435\u043c\u0443 SIGQUIT (\u043e\u043d \u0436\u0435 Ctrl-\\).<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">import exconsole exconsole.register()  do_dangerous_stuff() <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e:<\/p>\n<pre><code class=\"python\">Activating emergency console ---------------------------- Caused by: ZeroDivisionError integer division or modulo by zero  Stack frames:   [  0] example.py:17    [  1] example.py:15               Tester().test()   [  2] example.py:9                   self.inner()   [  3] example.py:6                   self.divide(2, 0) &gt; [  4] example.py:3                   return a \/ b On frame 4 Source:            def divide(self, a, b):     &gt;&gt;         return a \/ b  Press Ctrl-D to leave console Type &quot;_help()&quot;&quot; for built-in commands  &gt;&gt;&gt; print a,b 2 0 &gt;&gt;&gt; _f(3) On frame 3 Source:            def inner(self):     &gt;&gt;         self.divide(2, 0)  &gt;&gt;&gt; print self &lt;__main__.Tester instance at 0x7f67c9a0e440&gt; <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0444\u0440\u0435\u0439\u043c\u0430\u043c \u0441\u0442\u0435\u043a\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043c\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0439\u0442\u0438 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<ul>\n<li><b>_s()<\/b> \u2014 \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0435\u043a\u0430<\/li>\n<li><b>_f(index)<\/b> \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0440\u0435\u0439\u043c<\/li>\n<li><b>_exc<\/b> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0439\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0431\u044b\u043b\u043e)<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f Python 2.6+ \u0438 3.<br \/>  \u041f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f Debian \u0438 CentOS \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 <a href=\"http:\/\/docs.ajenti.org\/man\/install\/general.html\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Ajenti<\/a><br \/>  \u0421\u0441\u044b\u043b\u043a\u0438: <a href=\"https:\/\/github.com\/Eugeny\/exconsole\">Github<\/a> <a href=\"https:\/\/pypi.python.org\/pypi\/python-exconsole\">PyPI<\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/190924\/\"> http:\/\/habrahabr.ru\/post\/190924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u0441\u0442 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u0435\u0440\u0445\u043a\u0440\u0430\u0442\u043a\u0438\u043c.<\/p>\n<p>  <b>ExConsole<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c-\u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u0432 Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043b\u0438\u0431\u043e \u043f\u043e \u043f\u0440\u0438\u0435\u043c\u0443 SIGQUIT (\u043e\u043d \u0436\u0435 Ctrl-\\).<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">import exconsole exconsole.register()  do_dangerous_stuff() <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e:<\/p>\n<pre><code class=\"python\">Activating emergency console ---------------------------- Caused by: ZeroDivisionError integer division or modulo by zero  Stack frames:   [  0] example.py:17    [  1] example.py:15               Tester().test()   [  2] example.py:9                   self.inner()   [  3] example.py:6                   self.divide(2, 0) &gt; [  4] example.py:3                   return a \/ b On frame 4 Source:            def divide(self, a, b):     &gt;&gt;         return a \/ b  Press Ctrl-D to leave console Type &quot;_help()&quot;&quot; for built-in commands  &gt;&gt;&gt; print a,b 2 0 &gt;&gt;&gt; _f(3) On frame 3 Source:            def inner(self):     &gt;&gt;         self.divide(2, 0)  &gt;&gt;&gt; print self &lt;__main__.Tester instance at 0x7f67c9a0e440&gt; <\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-190924","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190924"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190924\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}