Popular Python recipes tagged "macro"http://code.activestate.com/recipes/langs/python/tags/macro/2012-03-31T21:28:12-07:00ActiveState Code RecipesPython Template Engine (Python) 2012-03-31T21:28:12-07:00Sunjay Varmahttp://code.activestate.com/recipes/users/4174115/http://code.activestate.com/recipes/578090-python-template-engine/ <p style="color: grey"> Python recipe 578090 by <a href="/recipes/users/4174115/">Sunjay Varma</a> (<a href="/recipes/tags/attributes/">attributes</a>, <a href="/recipes/tags/engine/">engine</a>, <a href="/recipes/tags/filter/">filter</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/template/">template</a>). </p> <p>This is a simple template engine which allows you to replace macros within text. This engine allows for attributes and filters. The default implementation provides the entire string module as filters. Trying to use arguments will of course not work (since the framework supports no other arguments for the filter other than the filtered string itself).</p> Extract, expand and execute command from QEditor menu file in file association (Python) 2010-11-05T22:01:40-07:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577453-extract-expand-and-execute-command-from-qeditor-me/ <p style="color: grey"> Python recipe 577453 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/expansion/">expansion</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>Given a path to a primary file and a menu path, a section name and a command key, extract a command from a QEditor menu and execute it. Useful from context menu entries. Example use DoM.py -m {o}\menus.ini do.py * list, on my computer searches c:\source\python\menus.ini for the first command whose key begins with list. The command is executed without capturing its standard output.</p> Extract, expand and execute command from file (Python) 2010-11-05T22:24:40-07:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577454-extract-expand-and-execute-command-from-file/ <p style="color: grey"> Python recipe 577454 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/expansion/">expansion</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>This program extracts, expands and executes a command stored in an arbitrary file usually the primary file. This is similar to the #! facility in UNIX. </p> Commandline Macro Expander (Python) 2010-11-15T03:27:16-08:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577463-commandline-macro-expander/ <p style="color: grey"> Python recipe 577463 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/expander/">expander</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/win32/">win32</a>). </p> <p>This program is designed to be executed from a console window on a Win32 platform. It expands user entered commands. Three styles of commands are accepted 'x comp myfile.c', 'x #!test myfile.exe test.dat' and 'x {print} myfile.c' to extract, expand and excute commands saved in a menu file, an arbitrary file or associated with a file type in the Win32 registry.</p> Komodo Python Macro - select the current word under the cursor (Python) 2010-01-14T12:30:45-08:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577006-komodo-python-macro-select-the-current-word-under-/ <p style="color: grey"> Python recipe 577006 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/cursor/">cursor</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/toddw/">toddw</a>, <a href="/recipes/tags/word/">word</a>). Revision 6. </p> <p>A <a href="http://www.activestate.com/komodo">Komodo</a> Python macro that can be used to select the current word under the cursor position.</p> <p>JavaScript version here: <a href="http://code.activestate.com/recipes/577007/">Recipe 577007</a>.</p>