Popular recipes by Phil Rist http://code.activestate.com/recipes/users/4171119/2011-01-19T17:51:13-08:00ActiveState Code RecipesExtract, 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> A Buttonbar program with color (Python) 2010-11-16T07:02:50-08:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577462-a-buttonbar-program-with-color/ <p style="color: grey"> Python recipe 577462 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/buttonbar/">buttonbar</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/execution/">execution</a>, <a href="/recipes/tags/win32/">win32</a>). Revision 2. </p> <p>An improved buttonbar program. Allows user to execute command by clicking button. <br /> Designed to be executed from a file association on a Win32 platform. Replaces <a href="http://code.activestate.com/recipes/577038/">recipe 577038</a>. Useful for commands requiring multiple related files.</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> Run command in Win32 Registry (Python) 2010-10-25T05:14:49-07:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577441-run-command-in-win32-registry/ <p style="color: grey"> Python recipe 577441 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command_execution/">command_execution</a>, <a href="/recipes/tags/win32/">win32</a>). Revision 2. </p> <p>Each file type has several commands saved in the registry and associated with the file type. These commands appear in the context menu for files of that file type. It seemed wasteful to replicate these commands with QEditor and Crimson Editor. DoCommand extracts the command from the registry, replaces macros and '%1' and '%*' strings and executes the command similar to the Do.py program.</p> An extension to Do.py Win32 Command submitter (Python) 2011-01-19T17:51:13-08:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577440-an-extension-to-dopy-win32-command-submitter/ <p style="color: grey"> Python recipe 577440 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/comand/">comand</a>, <a href="/recipes/tags/win32/">win32</a>). Revision 2. </p> <p>This program expands upon my Do.py program (Recipe: 577439). Instead of doing one expansion for the entire comand, it performs an expansion on each argument. It uses the Do.py program preserving macro definitions.</p> Simple command submitter for Win32 (Python) 2010-10-25T01:59:49-07:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577439-simple-command-submitter-for-win32/ <p style="color: grey"> Python recipe 577439 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/expanding/">expanding</a>, <a href="/recipes/tags/win32/">win32</a>). </p> <p>This program is a simple Win32 command submitter. It uses a set of macros similar to those used by the QEditor program, strings such as '{b}'. The macros are replaced with text from a specified file path. Options to change the working directory and selected environment variables are provided. Two examples are provided in the code. <br /> The program does not collect output or provide input. It does one call to the expand routine. It can not recognize parameters containing white space. Do2 which follows does. Module is used by Do2 and ButtonBarV1Ex which follow.</p> Simple Buttonbar Utility Version 1 (Python) 2010-02-09T23:02:40-08:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577038-simple-buttonbar-utility-version-1/ <p style="color: grey"> Python recipe 577038 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command_execution/">command_execution</a>, <a href="/recipes/tags/user_interface/">user_interface</a>). Revision 4. </p> <p>Display buttonbar generated from .ini style file of command templates. Commandline contains path used to generate commands. Templates can contain macros which will be replaced by parts of the file path. Template 'copy {a} {u}\{f}' could copy selected file {a} to backup directory {u} with same file name {f}. Command line specifies name of .ini file and which sections to include in buttonbar. Not all need be used.</p> A Moderately Simple Buttonbar Program (Python) 2010-02-10T02:08:37-08:00Phil Risthttp://code.activestate.com/recipes/users/4171119/http://code.activestate.com/recipes/577039-a-moderately-simple-buttonbar-program/ <p style="color: grey"> Python recipe 577039 by <a href="/recipes/users/4171119/">Phil Rist</a> (<a href="/recipes/tags/command_execution/">command_execution</a>, <a href="/recipes/tags/user_interface/">user_interface</a>). </p> <p>This buttonbar program is similar to my ButtonBarV1 <a href="http://code.activestate.com/recipes/577038/">recipe 577038</a> except a file pattern such as c:\source\python\new*.py can be entered instead of a single file. This will allow you to scroll through a list of matching files selecting the files you want to process. You must still select the command separately for each file. Besides the file pattern or file a menu file and an optional list of section names are specified on the command line.</p>