Python Code Snippets

04 December, 2011   

Example of If Statement in python

04 December, 2011   

This snippet represents a simple deserializer of some basic Python types.

Python has no equivalent to Java's "super" keyword (so that some part of a method can be delegated to the superclass), but it's easy to get similar convenience despite Python's multiple-inheritance generality.

03 August, 2013   

Example shows bash code to change CWD to file's directory

Python code example for Grid made by the Label with Raised border

08 January, 2014   

Simple Python IRC bot by Berend.

11 October, 2012   

Python code example for Grid made by Label and Entry

25 February, 2013   

AppleScript code example to restart Django development server

The pyperl dist provide an interface to the Perl DBI ( This allow direct access to all the perl supported databases from python. Full documentation of the API from 'perldoc DBI' or the ORA "Programming the Perl DBI" book, by A. Descartes and T. Bunce.

28 June, 2012   

Function to generate soundex code for any string (usually a name). Conforms to Knuth's algorithm and the common Perl implementation.

The example below shows how to produce a png image from python code, but pygments supports lexers for many other languages and its formatter classes can produce other image formats too. The ImageFormatter class allows to set various parameters of the resulting images.

04 July, 2011   

Here are the Python code Checkbox menu

Python functions are naturally polymorphic on their arguments, and checking argument types loses polymorphism

31 May, 2015   

Enhanced for loop is useful when scanning the array instead of using for loop.

18 August, 2011   

The example Python code to Rotate sequences left or right

04 July, 2011   

Animation with threads by John E. Grayson

This basic snippet will create a random authentication code, or just a random string.

How to display the source code of any webpage. you can use below example code

04 October, 2012   

Code example for parsing XML in easy way using PHP

04 July, 2012   

Good programmer comments their code so that anyone can know what is happening in code. Its easy for others to edit the code.