| python Programming Glossary: recipeShowing the stack trace from a running Python application http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application 
 Force Python to forego native sqlite3 and use the (installed) latest sqlite3 version http://stackoverflow.com/questions/1545479/force-python-to-forego-native-sqlite3-and-use-the-installed-latest-sqlite3-ver  enable it you can build pysqlite2 manually. The following recipe assumes a unix y system and the lastest version of pysqlite2.. sqlite3.connect memory con.execute create virtual table recipe using fts3 name ingredients pysqlite2.dbapi2.Cursor object at.. 
 When and how to use the builtin function property() in python http://stackoverflow.com/questions/1554546/when-and-how-to-use-the-builtin-function-property-in-python  the fact that a.b 2 isn't a simple assignment looks like a recipe for trouble either because some unexpected result can happen.. 
 Does Python have an ordered set? http://stackoverflow.com/questions/1653970/does-python-have-an-ordered-set    share improve this question   There is an ordered set recipe for this which is referred to from the Python Documentation.. 
 Fastest way to list all primes below N in python http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python  implementation by myself 327ms Daniel's Sieve 435ms Alex's recipe from Cookbok 710ms EDIT ~unutbu is leading the race .  python.. 
 How to implement an efficient infinite generator of prime numbers in Python? http://stackoverflow.com/questions/2211990/how-to-implement-an-efficient-infinite-generator-of-prime-numbers-in-python  question   I still like what I wrote up here a Cookbook recipe with many other authors it shows how a Sieve of Eratosthenes.. 
 Python analog of natsort function (sort a list using a “natural order” algorithm) http://stackoverflow.com/questions/2545532/python-analog-of-natsort-function-sort-a-list-using-a-natural-order-algorithm  builtin an not in the standard library AFAIK. There's a recipe for it here and other implementations can be found by Google... 
 How to get current CPU and RAM usage in Python? http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python  and MEMORYSTATUS in ctypes.windll.kernel32 see this recipe on ActiveState for the Windows platform. One could put a Python.. 
 What are “named tuples” in Python? http://stackoverflow.com/questions/2970608/what-are-named-tuples-in-python  added in Python 2.6 and Python 3.0 although there is a recipe for implementation in Python 2.4 . For example it is common.. change the values you need another type. There is a handy recipe for mutable recordtypes which allow you to set new values to.. 
 How do I eliminate Windows consoles from spawned processes in Python (2.7)? [duplicate] http://stackoverflow.com/questions/3390762/how-do-i-eliminate-windows-consoles-from-spawned-processes-in-python-2-7  ppm_data Thanks to Ricardo Reyes Minor revision to that recipe in 2.7 it appears that you need to get STARTF_USESHOWWINDOW.. 
 raw_input in python without pressing enter http://stackoverflow.com/questions/3523174/raw-input-in-python-without-pressing-enter  see the docs I just pointed to . For Unix see e.g. this recipe for a simple way to build a similar getch function see also.. 
 python equivalent of filter() getting two output lists (i.e. partition of a list) http://stackoverflow.com/questions/4578590/python-equivalent-of-filter-getting-two-output-lists-i-e-partition-of-a-list  7 There is also an implementation suggestion in itertools recipes from itertools import filterfalse tee def partition pred iterable.. tee iterable return filterfalse pred t1 filter pred t2 The recipe comes from the Python 3.x documentation. In Python 2.x filterfalse.. 
 How do you create a daemon in Python? http://stackoverflow.com/questions/473620/how-do-you-create-a-daemon-in-python  reveals x2 code snippets. The first result is to this code recipe which has a lot of documentation and explanation along with.. 
 Timeout on a Python function call http://stackoverflow.com/questions/492519/timeout-on-a-python-function-call  the following code borrowed from an ActiveState Cookbook recipe def timeout func args kwargs timeout_duration 10 default None.. 
 Iterating over every two elements in a list http://stackoverflow.com/questions/5389507/iterating-over-every-two-elements-in-a-list  process. N.B This should not be confused with the pairwise recipe in Python's own itertools documentation which yields s s0 s1.. 
 Iterate an iterator by chunks (of n) in Python? http://stackoverflow.com/questions/8991506/iterate-an-iterator-by-chunks-of-n-in-python  iterator   share improve this question   The grouper recipe from the itertools documentation's recipes comes close to what..   The grouper recipe from the itertools documentation's recipes comes close to what you want def grouper n iterable fillvalue.. 
 how to install PIL on mac os x 10.7.2 Lion http://stackoverflow.com/questions/9070074/how-to-install-pil-on-mac-os-x-10-7-2-lion  questions. However I still couldn't find a clear simple recipe to install PIL for python 2.6 or 2.7 on mac os x 10.7.2 Lion... 
 Interleaving Lists in Python [duplicate] http://stackoverflow.com/questions/11125212/interleaving-lists-in-python  iterables roundrobin 'ABC' 'D' 'EF' A D E B F C # Recipe credited to George Sakkis pending len iterables nexts cycle.. 
 Automatically determine the natural language of a website page given its URL http://stackoverflow.com/questions/1167262/automatically-determine-the-natural-language-of-a-website-page-given-its-url  Python as others have suggested see this Python Cookbook Recipe from ActiveState . The Google Natural Language Detection API.. 
 interleaving 2 lists of unequal lengths [duplicate] http://stackoverflow.com/questions/19883826/interleaving-2-lists-of-unequal-lengths  iterables roundrobin 'ABC' 'D' 'EF' A D E B F C # Recipe credited to George Sakkis pending len iterables nexts cycle.. 
 Language detection in python [duplicate] http://stackoverflow.com/questions/2161290/language-detection-in-python  this question   http code.activestate.com recipes 326576 Recipe 326576 Language detection using character trigrams The Trigram.. 
 Pinging servers in Python http://stackoverflow.com/questions/2953462/pinging-servers-in-python   share improve this question   You can look at this recipe Recipe 409689 icmplib library for creating and reading ICMP packets.. 
 python command line yes/no input http://stackoverflow.com/questions/3041986/python-command-line-yes-no-input  use raw_input . There is no built in way to do this. From Recipe 577058 import sys def query_yes_no question default yes Ask.. 
 How to read lines from a file in python starting from the end http://stackoverflow.com/questions/3568833/how-to-read-lines-from-a-file-in-python-starting-from-the-end  net that shows how to do the third approach ActiveState Recipe 120686 Read a text file backwards ActiveState Recipe 439045.. Recipe 120686 Read a text file backwards ActiveState Recipe 439045 Read a text file backwards yet another implementation.. 
 python: is it possible to attach a console into a running process http://stackoverflow.com/questions/4163964/python-is-it-possible-to-attach-a-console-into-a-running-process  code you can add this functionality relatively easily. See Recipe 576515 Debugging a running python process by interrupting and.. 
 Letter frequency in python http://stackoverflow.com/questions/5148903/letter-frequency-in-python  frm '' to '' delete '' keep None # Python Cookbook Recipe 1.9 # Chris Perkins Raymond Hettinger if len to 1 to to len.. 
 Simple HTTP Web Server [closed] http://stackoverflow.com/questions/530787/simple-http-web-server  no need to install anything no configuration needed See Recipe 365606 How to serve files from a directory and or testing CGI.. 
 What are the best Python Finite State Machine implementations http://stackoverflow.com/questions/5492980/what-are-the-best-python-finite-state-machine-implementations  w python target ... also see the FSMME Tutorial Python FSM Recipe Active State Code ... suited for text parsing tasks GOF State.. 
 Ignore case in Python strings http://stackoverflow.com/questions/62567/ignore-case-in-python-strings  string comparisons. ~~~~~~~~~~~~~~ ActiveState Code Recipe 194371 Case Insensitive Strings is a recipe for creating a case.. 
 Python: Sending Multipart html emails which contain embedded images http://stackoverflow.com/questions/920910/python-sending-multipart-html-emails-which-contain-embedded-images   share improve this question   Here is an example I found. Recipe 473810 Send an HTML email with embedded image and plain text.. 
 |