Popular recipes tagged "interpreter" but not "algorithm"http://code.activestate.com/recipes/tags/interpreter-algorithm/2016-09-22T12:25:30-07:00ActiveState Code RecipesSimple Matlab/Ocave like arrays conversion to numpy.arrays in python interpreter (Python) 2016-09-22T12:25:30-07:00Przemyslaw Podczasihttp://code.activestate.com/recipes/users/4179716/http://code.activestate.com/recipes/580700-simple-matlabocave-like-arrays-conversion-to-numpy/ <p style="color: grey"> Python recipe 580700 by <a href="/recipes/users/4179716/">Przemyslaw Podczasi</a> (<a href="/recipes/tags/array/">array</a>, <a href="/recipes/tags/interpreter/">interpreter</a>, <a href="/recipes/tags/matlab/">matlab</a>). </p> <p>Matlab/Octave syntax for 1D/2D arrays is more packed and doesn't require putting extra ',' and extra '[', ']' between dimensions. For this I wrote a parser that intercepts python interpreter and using numpy functionality parses Matlab's style arrays 1D and 2D into numpy.arrays.</p> The Easy Cow (Python) 2012-12-06T14:22:36-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578367-the-easy-cow/ <p style="color: grey"> Python recipe 578367 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/interpreter/">interpreter</a>). </p> <p>If you thought the programs for <a href="http://code.activestate.com/recipes/578366/">recipe 578366</a> were too difficult to understand, you have just found an upgrade to the COW language: mnemonics humans can understand. This recipe makes a slight alteration to the interpreter so as to take the decoded instructions instead of the COW (moo) instructions.</p> The Normal Cow (Python) 2012-12-06T14:14:28-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578366-the-normal-cow/ <p style="color: grey"> Python recipe 578366 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/interpreter/">interpreter</a>). </p> <p>Ever heard of an esoteric language named COW or wanted to run a program written with just the letters M and O? This recipe provides a COW interpreter that is able to run such programs and decodes them so that they are much easier to read for those who do not know the common bovine tongue.</p> EZ DDX COW (Python) 2012-12-07T02:21:51-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578373-ez-ddx-cow/ <p style="color: grey"> Python recipe 578373 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/interpreter/">interpreter</a>). </p> <p>As with the original easy cow in <a href="http://code.activestate.com/recipes/578367/">recipe 578367</a>, a simple change to the original program allows for programming in a much more human-readable way. This recipe also allows for DDX programming and provides two more example COW programs below it as a demonstration of what may be done with the interesting language.</p> COW with DDX (Python) 2012-12-07T02:17:19-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578372-cow-with-ddx/ <p style="color: grey"> Python recipe 578372 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/interpreter/">interpreter</a>). </p> <p>Once you get bored with <a href="http://code.activestate.com/recipes/578366/">recipe 578366</a>, extending COW with DDX (Distributed Digestion eXtentions) provides a way to enhance program and replace instructions with more powerful options. This recipe provides a COW interpreter that utilities extra stomachs for the bovines to do their processing in.</p> Teach the hashbang header new tricks using a dual mode shell/python script (Python) 2011-08-21T07:27:05-07:00Oren Tiroshhttp://code.activestate.com/recipes/users/2033964/http://code.activestate.com/recipes/577851-teach-the-hashbang-header-new-tricks-using-a-dual-/ <p style="color: grey"> Python recipe 577851 by <a href="/recipes/users/2033964/">Oren Tirosh</a> (<a href="/recipes/tags/hashbang/">hashbang</a>, <a href="/recipes/tags/interpreter/">interpreter</a>, <a href="/recipes/tags/options/">options</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/sh/">sh</a>, <a href="/recipes/tags/shell/">shell</a>). </p> <p>This dual-mode script is both a Posix shell script and a python script. The shell part looks like a triple-quoted string to the Python interpreter. The shell does not reach anything after the exec statement.</p> Whitespace Interpreter (Python) 2010-05-24T12:02:11-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577110-whitespace-interpreter/ <p style="color: grey"> Python recipe 577110 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/interpreter/">interpreter</a>, <a href="/recipes/tags/whitespace/">whitespace</a>). Revision 2. </p> <p>Runs programs in "Programs" and creates *.WSO files when needed.</p> <p>Can be executed directly by double-click or on the command line.</p> <p>If run on command line, add "ASM" flag to dump program assembly.</p>