
{"id":15996,"date":"2014-10-19T10:58:33","date_gmt":"2014-10-19T10:58:33","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=15996"},"modified":"2014-10-19T10:58:33","modified_gmt":"2014-10-19T10:58:33","slug":"project-euler-problem-3-solution-internals-using-python-debugger","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2014\/10\/19\/project-euler-problem-3-solution-internals-using-python-debugger\/","title":{"rendered":"Project Euler Problem 3, solution internals using python debugger"},"content":{"rendered":"<pre>\n$python -m pdb euler-three.py \n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(7)()\n-&gt; '''\n(Pdb) r\n6857\n--Return--\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(17)()-&gt;None\n-&gt; print n\n(Pdb) next\n--Return--\n&gt; (1)()-&gt;None\n(Pdb) next\nThe program finished and will be restarted\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(7)()\n-&gt; '''\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(9)()\n-&gt; n = 600851475143\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(11)()\n-&gt; i = 2\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(12)()\n-&gt; while i * i  \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(13)()\n-&gt; while n % i == 0:\n(Pdb) print n\n600851475143\n(Pdb) print n % i\n1\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(15)()\n-&gt; i = i + 1\n(Pdb) print i\n2\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(12)()\n-&gt; while i * i  \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(13)()\n-&gt; while n % i == 0:\n(Pdb) print n % i\n2\n(Pdb) next\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(15)()\n-&gt; i = i + 1\n(Pdb) continue\n6857\nThe program finished and will be restarted\n&gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(7)()\n-&gt; '''\n(Pdb) \n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$python -m pdb euler-three.py &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(7)() -&gt; &#8221;&#8217; (Pdb) r 6857 &#8211;Return&#8211; &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(17)()-&gt;None -&gt; print n (Pdb) next &#8211;Return&#8211; &gt; (1)()-&gt;None (Pdb) next The program finished and will be restarted &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(7)() -&gt; &#8221;&#8217; (Pdb) next &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(9)() -&gt; n = 600851475143 (Pdb) next &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(11)() -&gt; i = 2 (Pdb) next &gt; \/home\/jeffrin\/beautifulwork\/lib\/euler-three.py(12)() &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2014\/10\/19\/project-euler-problem-3-solution-internals-using-python-debugger\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project Euler Problem 3, solution internals using python debugger&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,31,78,91,93],"tags":[1007],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15996"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=15996"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15996\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=15996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=15996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=15996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}