document.open();document.writeln('<div onmouseover="document.getElementById(\'snipt-9686\').style.display = \'block\'; return false;" onmouseout="document.getElementById(\'snipt-9686\').style.display = \'none\'; return false;" style="position: relative;">');document.writeln('<div class="highlight"><pre style="-moz-border-radius: 5px; border-radius: 5px; -webkit-border-radius: 5px; margin: 0; display: block; font: 11px Monaco, monospace !important; padding: 15px; background-color: #1C1C1C; overflow: auto; color: #D0D0D0;"><span style="color: #999999; font-style: italic">#!/usr/bin/env python</span>');document.writeln('<span style="color: #999999; font-style: italic"># oblogdefelix.blogspot.com</span>');document.writeln('<span style="color: #999999; font-style: italic"># see usage below</span>');document.writeln('');document.writeln('<span style="color: #6ab825; font-weight: normal">import</span> <span style="color: #447fcf; text-decoration: underline">sys</span><span style="color: #d0d0d0">,</span><span style="color: #447fcf; text-decoration: underline">string</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">from</span> <span style="color: #447fcf; text-decoration: underline">numpy</span> <span style="color: #6ab825; font-weight: normal">import</span> <span style="color: #d0d0d0">*</span>');document.writeln('');document.writeln('<span style="color: #24909d">list</span><span style="color: #d0d0d0">=sys.argv</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">if</span> <span style="color: #d0d0d0">(size(</span><span style="color: #24909d">list</span><span style="color: #d0d0d0">)&gt;</span><span style="color: #3677a9">1</span><span style="color: #d0d0d0">):</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">del</span> <span style="color: #24909d">list</span><span style="color: #d0d0d0">[</span><span style="color: #3677a9">0</span><span style="color: #d0d0d0">]</span>');document.writeln('   <span style="color: #d0d0d0">expr=string.join(</span><span style="color: #24909d">list</span><span style="color: #d0d0d0">,</span><span style="color: #ed9d13">&#39;&#39;</span><span style="color: #d0d0d0">)</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #d0d0d0">expr,</span><span style="color: #ed9d13">&#39;=&#39;</span>');document.writeln('   <span style="color: #d0d0d0">x=</span><span style="color: #24909d">compile</span><span style="color: #d0d0d0">(expr,</span><span style="color: #ed9d13">&#39;&#39;</span><span style="color: #d0d0d0">,</span><span style="color: #ed9d13">&#39;eval&#39;</span><span style="color: #d0d0d0">)</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #24909d">eval</span><span style="color: #d0d0d0">(x)</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">else</span><span style="color: #d0d0d0">:</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;Usage:&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&quot; calcfx &#39;expression&#39;&quot;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;Ex:&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&quot; calcfx &#39;3.*sin(pi/4.)&#39;&quot;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&quot; calcfx &#39;roots(array([1. 0. -1.]))&#39;&quot;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39;Note: always use decimal point or operations can be understood as integer operation:&#39;</span>');document.writeln('   <span style="color: #6ab825; font-weight: normal">print</span> <span style="color: #ed9d13">&#39; 1/2 and 1./2. are 0 and 0.5 respectively</span>');document.writeln('</pre></div>');document.writeln('');document.writeln('<div style="background-color: #111; color: #D0D0D0; float: right; padding: 5px 10px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; font: 11px Arial,Sans-Serif; display: none; position: absolute; bottom: 0; right: 0;" id="snipt-9686">code hosted by <a href="http://snipt.net/voyeg3r/python-cientific-calculator" style="color: #0084FF; text-decoration: none;">snipt.net</a></div>');document.writeln('</div>');document.close();