Popular recipes tagged "window"http://code.activestate.com/recipes/tags/window/2012-12-17T12:47:14-08:00ActiveState Code RecipesA DEMO To Show How To Expand A Standard Python Terminal On The Fly... (Python) 2012-12-17T12:47:14-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578383-a-demo-to-show-how-to-expand-a-standard-python-ter/ <p style="color: grey"> Python recipe 578383 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/campimeter/">campimeter</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/size/">size</a>, <a href="/recipes/tags/terminal/">terminal</a>, <a href="/recipes/tags/window/">window</a>). </p> <p>This code shows how to open up a default Terminal running Python to tha maximum allowed on the _desktop_. I decided on writing code to do a crude emulation of a Campimeter. Anyone who has worn spectacles for a long time has had this test done at the optician's. Originally written for a Macbook Pro, OSX 10.7.5 but also tested on Debian Linux 6.0.x. READ the code for more information!!! This code WILL alter the size of the Terminal window AND changes the colours too, although it is very easy to return back to the default state it is NOT included in the code... I EXPECT professionals to know how to doo that.</p> <p>Before running Python inside the Terminal ensure the Terminal window is at the uppermost left hand corner of your desktop...</p> <p>I needed the maximised Python Terminal for something else but this was the easiest way to demonstrate ho to do it through Python...</p> <p>Written so that kids can understand what is going on...</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> Windowing an iterable with itertools (Python) 2010-04-15T18:45:41-07:00Daniel Cohnhttp://code.activestate.com/recipes/users/4172918/http://code.activestate.com/recipes/577196-windowing-an-iterable-with-itertools/ <p style="color: grey"> Python recipe 577196 by <a href="/recipes/users/4172918/">Daniel Cohn</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/iterable/">iterable</a>, <a href="/recipes/tags/iterator/">iterator</a>, <a href="/recipes/tags/loop/">loop</a>, <a href="/recipes/tags/peeking/">peeking</a>, <a href="/recipes/tags/window/">window</a>). </p> <p>Oftentimes a programmer needs to peek into an iterator without advancing it, a task for which many good solutions already exist. But what if the intrepid coder needs a fast and pythonic way to 'window' the data? This recipe demonstrates how to wrap any iterable with a class that adds two methods, prev and peek.</p> Komodo JS Macro - force the focus back onto the editor after an alt-tab (JavaScript) 2010-03-29T18:59:03-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577164-komodo-js-macro-force-the-focus-back-onto-the-edit/ <p style="color: grey"> JavaScript recipe 577164 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/focus/">focus</a>, <a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/setfocus/">setfocus</a>, <a href="/recipes/tags/tab/">tab</a>, <a href="/recipes/tags/window/">window</a>). </p> <p>A <a href="http://www.activestate.com/komodo">Komodo</a> JavaScript macro that can be used to force the focus back to the Komodo editor after switching between windows (i.e. after using Alt-Tab).</p> <p>This macro only applies to Windows and Mac OS - where there is an application activated notification event available.</p> <p>To use this macro - set the macro to trigger on the "On startup" event.</p>