Popular recipes tagged "meta:loc=146"http://code.activestate.com/recipes/tags/meta:loc=146/2016-03-11T03:39:32-08:00ActiveState Code RecipesCatalog multiple drives (Python) 2016-03-11T03:39:32-08:00Jack Trainorhttp://code.activestate.com/recipes/users/4076953/http://code.activestate.com/recipes/580619-catalog-multiple-drives/ <p style="color: grey"> Python recipe 580619 by <a href="/recipes/users/4076953/">Jack Trainor</a> (<a href="/recipes/tags/drives/">drives</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/utility/">utility</a>). </p> <p>As one accumulates multiple drives, hard and flash, containing, thousands even millions of files, it becomes useful to have a text file containing an alphabetized catalog list of all files and their locations by drive and directory.</p> <p>The list can be searched by eye or by an editor to locate particular files.</p> <p>The list can also be loaded into a script to be filtered programmatically as desired.</p> List comparison, difference and more using set & frozenset (Python) 2012-11-01T10:30:58-07:00Scott S-Allenhttp://code.activestate.com/recipes/users/4181178/http://code.activestate.com/recipes/578310-list-comparison-difference-and-more-using-set-froz/ <p style="color: grey"> Python recipe 578310 by <a href="/recipes/users/4181178/">Scott S-Allen</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/contain/">contain</a>, <a href="/recipes/tags/difference/">difference</a>, <a href="/recipes/tags/lambda/">lambda</a>, <a href="/recipes/tags/list/">list</a>, <a href="/recipes/tags/remove/">remove</a>, <a href="/recipes/tags/set/">set</a>, <a href="/recipes/tags/union/">union</a>). </p> <p>Python has a powerful suite of tools for comparing lists by way of sets and frozensets. Here are a few examples and conveniences that many newcomers, even a few seasoned developers, are unaware.</p> State tree (Python) 2012-06-06T14:38:21-07:00Glenn Hutchingshttp://code.activestate.com/recipes/users/4175415/http://code.activestate.com/recipes/578159-state-tree/ <p style="color: grey"> Python recipe 578159 by <a href="/recipes/users/4175415/">Glenn Hutchings</a> (<a href="/recipes/tags/deque/">deque</a>). </p> <p>Explore a tree of states to find a goal state.</p> Compare speeds of different kinds of access to variables (Python) 2011-08-10T23:54:12-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/577834-compare-speeds-of-different-kinds-of-access-to-var/ <p style="color: grey"> Python recipe 577834 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/optimization/">optimization</a>). Revision 5. </p> <p>Compare speeds of locals, nested scopes, global, builtins, instance variables, and class variables.</p> Simple Morse Code Generator And Tutor. (Python) 2012-01-09T22:51:12-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578009-simple-morse-code-generator-and-tutor/ <p style="color: grey"> Python recipe 578009 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/morse/">morse</a>, <a href="/recipes/tags/morse_code/">morse_code</a>, <a href="/recipes/tags/sound/">sound</a>). Revision 2. </p> <p>This is not for the big guns, but for the Amateur coder AND radio enthusiast.</p> <p>It is a DEMO Morse Code Generator and tutor that will generate the tones required for the original standard letters A to Z and numbers 0 to 9. Puctuation is NOT included but hey it is SOOOO simple to modify the code that I will let you, (the ones interested), do that for yourselves... ;o) Read the code for more informaton.</p> <p>It is for at least standard text mode Python 2.5.2 to 2.7.2 using PCLinuxOS 2009 and Debian 6.0.0. It may well work at a much earlier version. I do have a version for Python 3.x.x but that will be uploaded elsewhere.</p> <p>As it stands it _sends_ at around 8 WPM, (Words Per Minute).</p> <p>It is written in such a way that youngsters can understand what is going on.</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> ur1.ca command-line client (Python) 2011-03-23T05:27:27-07:00Conghttp://code.activestate.com/recipes/users/4167149/http://code.activestate.com/recipes/577236-ur1ca-command-line-client/ <p style="color: grey"> Python recipe 577236 by <a href="/recipes/users/4167149/">Cong</a> (<a href="/recipes/tags/scraping/">scraping</a>, <a href="/recipes/tags/shortening/">shortening</a>, <a href="/recipes/tags/url/">url</a>, <a href="/recipes/tags/web/">web</a>). Revision 2. </p> <p>(ur1.ca)[http://ur1.ca/] is the URL shortening services provided by <a href="http://status.net" rel="nofollow">status.net</a>. This script makes it possible to access the service from the command line. This is done by scraping the returned page and look for the shortened URL.</p> EOQ (Python) 2009-02-17T03:20:33-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/576651-eoq/ <p style="color: grey"> Python recipe 576651 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/financial/">financial</a>, <a href="/recipes/tags/management/">management</a>). Revision 3. </p> <p>Economic order quantity (EOQ) model is used in stock control by many companies rather than other stock control systems such as the Just-in-Time model. Though, ACCA’s students will benefit from this program while preparing their ACCA course and exam in financial management towards their ACCA professional qualification, yet financial management professionals already holding posts within companies using this system will be able to compare different sets of item quantities and rates to reduce their company’s total cost of holding and ordering such items.</p> Login Logger (Python) 2009-01-05T08:53:34-08:00Kishhttp://code.activestate.com/recipes/users/4168196/http://code.activestate.com/recipes/576574-login-logger/ <p style="color: grey"> Python recipe 576574 by <a href="/recipes/users/4168196/">Kish</a> (<a href="/recipes/tags/client_server/">client_server</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/mysqldb/">mysqldb</a>). Revision 4. </p> <p>A server program that listens to a client program for logins and inserts the info into a MySQL database. The login info is sent to the server during the login by a editing the /etc/profile.</p> Recreate MS Access table in SQLite (Python) 2008-07-01T16:22:39-07:00K. Killebrewhttp://code.activestate.com/recipes/users/4144739/http://code.activestate.com/recipes/572165-recreate-ms-access-table-in-sqlite/ <p style="color: grey"> Python recipe 572165 by <a href="/recipes/users/4144739/">K. Killebrew</a> (<a href="/recipes/tags/database/">database</a>). Revision 9. </p> <p>A function to create and load a table in SQLite from a Microsoft Jet table, using DAO. Also recreates indexes. Fetches and loads records in blocks with a default size of 1000 rows.</p> Auto Generation of SQL Insert Statement Columns and Values from Object (Python) 2008-05-12T21:29:06-07:00Andrew Konstantarashttp://code.activestate.com/recipes/users/4141807/http://code.activestate.com/recipes/572197-auto-generation-of-sql-insert-statement-columns-an/ <p style="color: grey"> Python recipe 572197 by <a href="/recipes/users/4141807/">Andrew Konstantaras</a> (<a href="/recipes/tags/database/">database</a>). Revision 2. </p> <p>Automates the creation of SQL INSERT statements for the "simple" attributes in a python object by creating a string of an object's attribute names and a corresponding string of that object's attribute values. Simple attributes are those that are one of the following types: string, int, long, float, boolean, None.</p> Extending pyunit (Python) 2007-04-16T06:03:17-07:00Tim Watsonhttp://code.activestate.com/recipes/users/2565684/http://code.activestate.com/recipes/511475-extending-pyunit/ <p style="color: grey"> Python recipe 511475 by <a href="/recipes/users/2565684/">Tim Watson</a> (<a href="/recipes/tags/oop/">oop</a>). </p> <p>Extends pyunit with method decorators, allowing the programmer to 'anotate' test methods and expected exceptions, rather than having to adhere to a naming convention.</p> Table indentation (Python) 2004-02-14T03:50:24-08:00George Sakkishttp://code.activestate.com/recipes/users/2591466/http://code.activestate.com/recipes/267662-table-indentation/ <p style="color: grey"> Python recipe 267662 by <a href="/recipes/users/2591466/">George Sakkis</a> (<a href="/recipes/tags/text/">text</a>). Revision 7. </p> <p>A function for pretty-printing a table.</p> OpenGL TTF (TrueType Font) FPS (Frames Per Second) example (Python) 2002-02-20T12:23:39-08:00Nelson Rushhttp://code.activestate.com/recipes/users/144881/http://code.activestate.com/recipes/115418-opengl-ttf-truetype-font-fps-frames-per-second-exa/ <p style="color: grey"> Python recipe 115418 by <a href="/recipes/users/144881/">Nelson Rush</a> . </p> <p>An OpenGL example in Python using PyOpenGL and PyGame modules to render a spinning triangle while the FPS (Frames Per Second) is displayed in the upper right hand corner using a TrueType font.</p> URLNorm (Python) 2001-07-25T10:07:13-07:00Mark Nottinghamhttp://code.activestate.com/recipes/users/121980/http://code.activestate.com/recipes/66422-urlnorm/ <p style="color: grey"> Python recipe 66422 by <a href="/recipes/users/121980/">Mark Nottingham</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>Normalise a URL by collapsing case where appropriate, trimming '..' path segments, etc.</p>