Simple Python IRC bot by Berend.
Open up a text editor, copy & paste the code below. Save the file as: "commandlinefu.py" and exit the editor.
This can be used to get ARP mac address from a IP address. Remember that MAC addresses are in ARP tables (volatile), that's why a ping is done first. But i don't know if timing between ping call and ARP call is enough to make sense (of pinging).
Convert an IP address to an integer for easier storage. Also, convert an integer back to an IP address.
Python code example for Grid made by the Label with Raised border
Python code example for Grid made by Label and Entry
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.
Function to generate soundex code for any string (usually a name). Conforms to Knuth's algorithm and the common Perl implementation.
The pyperl dist provide an interface to the Perl DBI (dbi.py). 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.
The following are some useful functions to build URLs within a CGI script, for example to send a HTTP redirection header
Sending short text messages with socket datagrams is simple to implement and provides a very lightweight message passing idiom.
Python functions are naturally polymorphic on their arguments, and checking argument types loses polymorphism
This snippet represents a simple deserializer of some basic Python types.
Example of If Statement in python
The example Python code to Rotate sequences left or right
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.
Here are the Python code Checkbox menu
Animation with threads by John E. Grayson