Popular recipes tagged "meta:loc=79"http://code.activestate.com/recipes/tags/meta:loc=79/2015-07-29T18:20:36-07:00ActiveState Code Recipespython EMI calculator (Python) 2015-07-29T18:20:36-07:00Emil george jameshttp://code.activestate.com/recipes/users/4191910/http://code.activestate.com/recipes/579086-python-emi-calculator/ <p style="color: grey"> Python recipe 579086 by <a href="/recipes/users/4191910/">Emil george james</a> (<a href="/recipes/tags/calculator/">calculator</a>, <a href="/recipes/tags/emi/">emi</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>EMI Calculator is used to calculate Equated Monthly Installment(EMI) for Home Loans/Housing Loans,Car Loans &amp; Personal Advantages: What all this EMI Calculator does?</p> <p>. The Instant calculation of Loan EMI , Total Interest Payable and Total Payments to be done. . This can be used as EMI Calculator for Banks like HDFC, ICICI, SBI, AXIS etc. . This can be also used for calculating Home loans, Personal Loan, car loans , credit card, LIC loan</p> <p>How to calculate the EMI?</p> <p>The well known formula for calculating EMI is:</p> <p>Formula for EMI calculation</p> <p>[Formula] EMI = [(p*r/12) (1+r/12)^n]/[(1+r/12)^n – 1 ] where p = principal amount(primary loan amount) r = rate of interest per year n = Total number of Years</p> <p>output:</p> <p><a href="https://emilgeorgejames.wordpress.com/2015/07/29/python-emi-equated-monthly-installment-calculator/" rel="nofollow">https://emilgeorgejames.wordpress.com/2015/07/29/python-emi-equated-monthly-installment-calculator/</a></p> <p>for more python recepies visit :https://emilgeorgejames.wordpress.com/</p> RecursionError exception: concise and informative output (Python) 2015-07-05T23:46:59-07:00elazarhttp://code.activestate.com/recipes/users/4187847/http://code.activestate.com/recipes/578660-recursionerror-exception-concise-and-informative-o/ <p style="color: grey"> Python recipe 578660 by <a href="/recipes/users/4187847/">elazar</a> (<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/handler/">handler</a>, <a href="/recipes/tags/recursion/">recursion</a>). Revision 3. </p> <p>Replaces the default exception hook with one that, upon "infinite recursion", removes the last cycle. This results in a significantly cleaner and shorter error message.</p> <p>Usage: simply import &lt;module&gt; as _</p> <p>For more details see the descussion here: <a href="https://mail.python.org/pipermail/python-ideas/2013-September/023190.html" rel="nofollow">https://mail.python.org/pipermail/python-ideas/2013-September/023190.html</a></p> Poker Hands (Python) 2013-07-07T04:09:34-07:00Jason Friedmanhttp://code.activestate.com/recipes/users/4183835/http://code.activestate.com/recipes/578589-poker-hands/ <p style="color: grey"> Python recipe 578589 by <a href="/recipes/users/4183835/">Jason Friedman</a> (<a href="/recipes/tags/cards/">cards</a>, <a href="/recipes/tags/deck/">deck</a>, <a href="/recipes/tags/poker/">poker</a>, <a href="/recipes/tags/shuffle/">shuffle</a>). Revision 5. </p> <p>Deal random hands and categorize them. See also <a href="http://code.activestate.com/recipes/415504/">recipe 415504</a>.</p> Snowflake Simulation Using Reiter Cellular Automata (Python) 2013-01-08T05:25:49-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578390-snowflake-simulation-using-reiter-cellular-automat/ <p style="color: grey"> Python recipe 578390 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/fractal/">fractal</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>). Revision 2. </p> <p>This algorithm can create realistic looking snow crystals depending on the parameter values. (You can see good examples in the original paper by the author.)</p> <p>I also added coloring.</p> <p>Warning: Using current settings it takes about 30 minutes to run. I also do not recommend running it using IDLE.</p> affinity.py (Python) 2012-06-05T03:12:55-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578151-affinitypy/ <p style="color: grey"> Python recipe 578151 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/cpu_usage/">cpu_usage</a>, <a href="/recipes/tags/threadsafe/">threadsafe</a>). </p> <p>Allow a simple way to ensure execution is confined to one thread.</p> <p>This module defines the Affinity data type that runs code on a single thread. An instance of the class will execute functions only on the thread that made the object in the first place. The class is useful in a GUI's main loop.</p> Power Of Two (Python) 2010-11-28T16:05:19-08:00Thomas Lehmannhttp://code.activestate.com/recipes/users/4174477/http://code.activestate.com/recipes/577475-power-of-two/ <p style="color: grey"> Python recipe 577475 by <a href="/recipes/users/4174477/">Thomas Lehmann</a> (<a href="/recipes/tags/power_of_two/">power_of_two</a>). </p> <ul> <li>It's a simple algorithm doing nearly the same what you can do when calculating a multiplication on a piece on paper.</li> <li>In python you don't need this. You simply say 2**n and you have it; so see it as prototyping for a final C/C++ program where you are limited by the given datatypes ... as long you don't write a 'BigNumber' class.</li> </ul> wxPython LED control (Python) 2007-09-30T14:39:03-07:00Ian Eloffhttp://code.activestate.com/recipes/users/2227021/http://code.activestate.com/recipes/533125-wxpython-led-control/ <p style="color: grey"> Python recipe 533125 by <a href="/recipes/users/2227021/">Ian Eloff</a> . </p> <p>A LED control that can have different colors, each associated with a state. The default is green, amber, and red. Calling ledControl.State = 1 will set the color of the LED to the color by that index (given as a list in the constructor.) In the default case 0 is red, 1 is amber, and 2 is green.</p> Another generator for an arbitrary number of 'for' loops (Python) 2007-01-31T13:31:26-08:00Paddy McCarthyhttp://code.activestate.com/recipes/users/398009/http://code.activestate.com/recipes/502199-another-generator-for-an-arbitrary-number-of-for-l/ <p style="color: grey"> Python recipe 502199 by <a href="/recipes/users/398009/">Paddy McCarthy</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Saw <a href="http://code.activestate.com/recipes/502194/">recipe 502194</a> and wondered if I could do similar. I initially came up with function comb that enumerates all combinations. I wanted a generator however and so abandoned that approach for comb2 which is a little more complex.</p> rebase -- convert a number to/from any base in range(-256,257) (Python) 2006-07-18T16:55:42-07:00faulkner612http://code.activestate.com/recipes/users/2903960/http://code.activestate.com/recipes/496895-rebase-convert-a-number-tofrom-any-base-in-range-2/ <p style="color: grey"> Python recipe 496895 by <a href="/recipes/users/2903960/">faulkner612</a> . </p> <p>One function to rule them all....</p> z_cgi.py (Python) 2012-07-02T23:06:06-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/496854-z_cgipy/ <p style="color: grey"> Python recipe 496854 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/cgi/">cgi</a>). </p> <p>z_cgi.py provides a simple interface for CGI applications. It does not currently support reading information from standard in. Future versions will probably be delivered in a packaged format.</p> Ordered Dictionary (Python) 2007-12-23T12:22:05-08:00Doug Winterhttp://code.activestate.com/recipes/users/2508093/http://code.activestate.com/recipes/438823-ordered-dictionary/ <p style="color: grey"> Python recipe 438823 by <a href="/recipes/users/2508093/">Doug Winter</a> . Revision 2. </p> <p>Yet another ordered dict.</p> Basic Exception handling idiom using decorators (Python) 2005-04-06T04:25:10-07:00Anandhttp://code.activestate.com/recipes/users/760763/http://code.activestate.com/recipes/408937-basic-exception-handling-idiom-using-decorators/ <p style="color: grey"> Python recipe 408937 by <a href="/recipes/users/760763/">Anand</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). Revision 2. </p> <p>A basic exception handling idiom using decorators which allows you to re-use the exception handler for different functions, while customizing your handlers using arguments passed to an exception handling "decorator".</p> Poker hand primitives (Python) 2005-05-30T01:17:34-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/415504-poker-hand-primitives/ <p style="color: grey"> Python recipe 415504 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Handles logic for detecting straights and groups of repeats in the presence of wildcards and hands with more than five cards.</p> simple example to show off itertools.tee (Python) 2004-09-23T22:01:49-07:00John Nielsenhttp://code.activestate.com/recipes/users/135654/http://code.activestate.com/recipes/305588-simple-example-to-show-off-itertoolstee/ <p style="color: grey"> Python recipe 305588 by <a href="/recipes/users/135654/">John Nielsen</a> . Revision 7. </p> <p>Itertools.tee offers an interesting way to "remember" things that have happened. Itertools.tee makes multiple iterators from one (if you still have an the original iterator you do not use it). When you advance iterator 1 but not iterator 2, iterator 2 stays behind. Which means, if you later advance iterator 2, it the goes forward through the same data.</p> <p>In this example, I use iterator.tee to make 2 iterators, to allow an action to affect data that has been processed in the past. The first iterator, it_main, is what is used to process data normally in this case to do something like display an image selected. The second iterator, it_history, stays behind the first and only advances when a specific action arrives. In effect, it rolls forward through the data that it_main has already processed.</p> IsChangedMixin - have the contents of an instance been modified? (Python) 2004-08-31T03:53:28-07:00David Hugheshttp://code.activestate.com/recipes/users/628518/http://code.activestate.com/recipes/302742-ischangedmixin-have-the-contents-of-an-instance-be/ <p style="color: grey"> Python recipe 302742 by <a href="/recipes/users/628518/">David Hughes</a> (<a href="/recipes/tags/oop/">oop</a>). </p> <p>The IsChangedMixin can be added to any class and queried to determine if the class instance contents, or any other instances contained in the class instance, have been altered.</p> An example mega-widget widget providing a text widget with X and Y scrollbars. (Tcl) 2002-04-25T03:43:48-07:00Michael Kirkhamhttp://code.activestate.com/recipes/users/331882/http://code.activestate.com/recipes/122548-an-example-mega-widget-widget-providing-a-text-wid/ <p style="color: grey"> Tcl recipe 122548 by <a href="/recipes/users/331882/">Michael Kirkham</a> . </p> <p>This is a simple example of a mega-widget based on the "MegaWidget" procedure in "Simplified mega-widiget creation without class libraries" (<a href="http://aspn.activestate.com/ASPN/Cookbook/Tcl/Recipe/122547%29." rel="nofollow">http://aspn.activestate.com/ASPN/Cookbook/Tcl/Recipe/122547).</a></p> list type operations on strings-tuple (Python) 2002-04-10T13:28:31-07:00anurag uniyalhttp://code.activestate.com/recipes/users/127639/http://code.activestate.com/recipes/120203-list-type-operations-on-strings-tuple/ <p style="color: grey"> Python recipe 120203 by <a href="/recipes/users/127639/">anurag uniyal</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). Revision 3. </p> <p>Using this class user may call list type methods e.g sort,reverse,remove,index,pop on strings,tuple which don't support such operations</p> scheduler (Python) 2002-02-15T16:20:44-08:00Simon Fosterhttp://code.activestate.com/recipes/users/207220/http://code.activestate.com/recipes/114644-scheduler/ <p style="color: grey"> Python recipe 114644 by <a href="/recipes/users/207220/">Simon Foster</a> (<a href="/recipes/tags/threads/">threads</a>). </p> <p>A simple multi-threaded scheduler that enables tasks to be run at specified intervals.</p> Lock NT via screensaver (Python) 2002-01-11T01:49:31-08:00Darryl Dixonhttp://code.activestate.com/recipes/users/138790/http://code.activestate.com/recipes/106624-lock-nt-via-screensaver/ <p style="color: grey"> Python recipe 106624 by <a href="/recipes/users/138790/">Darryl Dixon</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). Revision 5. </p> <p>This code implements a Python solution for locking a workstation via a secure screensaver as recommended by the Microsoft KB article Q262646. It sets up a secure screensaver, then calls it. Really simple code.</p> Directory Size Lister for Windows (Python) 2001-11-02T19:59:19-08:00Frank Fejeshttp://code.activestate.com/recipes/users/139314/http://code.activestate.com/recipes/86554-directory-size-lister-for-windows/ <p style="color: grey"> Python recipe 86554 by <a href="/recipes/users/139314/">Frank Fejes</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>List the summed size of a directory (or set of directories) without the GUI. This recipe makes it quick and easy to see where all your disk space has gone! It has been tested under Windows and Unix, however it will probably be most useful under Windows considering the fact that Unix ships with a similar command, du.</p> <p>Have fun!</p>