Latest recipes tagged "console"http://code.activestate.com/recipes/tags/console/new/2014-04-16T15:36:04-07:00ActiveState Code RecipesTic Tac Toe console game (Python) 2013-06-18T10:52:27-07:00Russel Walkerhttp://code.activestate.com/recipes/users/4186920/http://code.activestate.com/recipes/578563-tic-tac-toe-console-game/ <p style="color: grey"> Python recipe 578563 by <a href="/recipes/users/4186920/">Russel Walker</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/python/">python</a>). Revision 2. </p> <p>Just a simple text based Tic Tac Toe game for human vs computer play. </p> <p>The game and AI reside in the TTTGame class. AI uses brute force search for 'perfect play'.</p> <p>The CLI class provides a text based console user interface.</p> Console CD Player (Python) 2012-07-11T12:26:10-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578207-console-cd-player/ <p style="color: grey"> Python recipe 578207 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/old/">old</a>, <a href="/recipes/tags/playback/">playback</a>). </p> <p>You have probably seen many different GUI programs that can play music on CDs. Well, here is a console-based recipe that can do the same thing. This is committed for archival to be run under Python 2.5 or later versions.</p> Easy ansi color plus more. (Ruby) 2014-04-16T15:36:04-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/578018-easy-ansi-color-plus-more/ <p style="color: grey"> Ruby recipe 578018 by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a> (<a href="/recipes/tags/ansi/">ansi</a>, <a href="/recipes/tags/clear/">clear</a>, <a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/cursor/">cursor</a>, <a href="/recipes/tags/formatting/">formatting</a>, <a href="/recipes/tags/movement/">movement</a>, <a href="/recipes/tags/output/">output</a>, <a href="/recipes/tags/ruby/">ruby</a>, <a href="/recipes/tags/screen/">screen</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/underline/">underline</a>). </p> <p>This quick class extends the base String class to add the ability to chain escape codes onto your output. For instance: puts 'String'.bold.underline.blink.red for something truly hideous. Aside from the colors (all are supported, but I haven't put in support for background colors as of the time of this post), cursor placement (ymmv based on the term type), screen clearing, bold, underline, blink reverse, conceal are all handled as well.</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> Holiday Leave (Python) 2010-07-01T13:21:09-07:00farciarzhttp://code.activestate.com/recipes/users/4172795/http://code.activestate.com/recipes/577280-holiday-leave/ <p style="color: grey"> Python recipe 577280 by <a href="/recipes/users/4172795/">farciarz</a> (<a href="/recipes/tags/argparse/">argparse</a>, <a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/holiday/">holiday</a>, <a href="/recipes/tags/leave/">leave</a>). </p> <p>Simple console tool that helps in maintenance your free days from work + basic tutorial how to use argparse in practice. It's clear and few lines of code. Enjoy! :-)</p> Precise console progress meter with ETA calculation (Python) 2010-04-18T21:11:40-07:00Denis Barmenkovhttp://code.activestate.com/recipes/users/57155/http://code.activestate.com/recipes/577002-precise-console-progress-meter-with-eta-calculatio/ <p style="color: grey"> Python recipe 577002 by <a href="/recipes/users/57155/">Denis Barmenkov</a> (<a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/eta/">eta</a>, <a href="/recipes/tags/meter/">meter</a>, <a href="/recipes/tags/progress/">progress</a>). Revision 13. </p> <p>After several attempts to use third-party modules I wrote my own console progress meter.</p> <p>Bonus list:</p> <ol> <li>calculation of ETA based on last update points. More accuracy when comparing with calculation ETA based on process start time (process can survive after Hibernate, but ETA has lost his accuracy)</li> <li>ability to write progress meter to sys.stderr</li> <li>update_left() method for multithreaded programs :)</li> </ol> Progress Bar for Console Programs as Iterator (Python) 2010-03-26T20:04:02-07:00Michael Grünewaldhttp://code.activestate.com/recipes/users/4172244/http://code.activestate.com/recipes/576986-progress-bar-for-console-programs-as-iterator/ <p style="color: grey"> Python recipe 576986 by <a href="/recipes/users/4172244/">Michael Grünewald</a> (<a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/cui/">cui</a>, <a href="/recipes/tags/progress/">progress</a>). Revision 6. </p> <p>A small proxy iterator showing a progress bar on the console. Only works with iterators that provide a length (i.e. <code>len(iterator)</code> must be defined).</p>