Index ¦ Archives ¦ Atom ¦ RSS > Tag: python

All your aliases are belong to you

HELLO I like setting up shortcuts to frequently used commands whether I used Windows or Linux. I use the terminal often and create shortcuts to frequently used commands using “alias” feature of BASH. This has saved me considerable time in the past. However, I recently felt that if I could ...

Command-line language translation

Here is a simple utility created using Python for translating text from various languages into English. It uses the Google AJAX API to do this.


prashanth@prashanth-desktop:~$ translate bonjour
prashanth@prashanth-desktop:~$ translate guten morgen
Good morning


#!/usr/bin/env python
Translates text into english using Google Translate ...

Clustering Data using Python

As a part of a project I am working on, I had to cluster urls on a page. After some light googling I found, python-cluster. You can find below a simple python script to illustrate the usage of python-cluster library.


import pprint
from difflib import SequenceMatcher

# http://python-cluster.sourceforge ...

Determining the difficulty of Arithmetic Operations

kid math
problemI am trying to write a program to test my arithmetic skills. The program should pose arithmetic problems involving the four basic operations - addition, subtraction, multiplication and division. When the testing session starts, the program should issue ...

Even a python can be abused


The first programming language I coded in is QuickBasic. I loved the simplicity and especially the IDE. It made things simple for a starter. Later I discovered Visual Basic which extended the same simplicity and added the “Visual ...

Nose - TDD - Python

What, why

I’ve been reading up on TDD and it has struck me as particularly useful methodology to achieve “clean code that works”. TDD encourages writing unit tests to cover all the code (because by definition, you write a test before a line of code is written). Because all ...

All NCERT text books!

I recently came to know that NCERT was providing all the text books (class 1 - 12) for download. However, I found their interface hard to use for browsing through. So I wrote a crawler in python to get all the books to my webserver.

Along with storing the books, I ...

Interfacing Python with C using ctypes

Python is a wonderful “very high level” language with an elegant design. It is an ultimate tool to rapidly develop applications. However, when it comes to performance (speed and memory), Python sucks. It is not meant for performance. So what do you do after building a quick prototype in python ...

Topic extraction using Wikipedia data

decorative graph

In an earlier article, I mentioned that I was trying to use Wikipedia data to do news article clustering to make it easy for me follow news feeds. I have made some progress. I’ve written an ...

Generating call graphs for understanding and refactoring python code

I have always been a fan of visualizations as I believe firmly that it is easier to crunch visual information than anything else. Visualizations are especially helpful for finding out patterns in data that are not expected and for patterns that are difficult to express textually in a concise manner ...

Ways to process and use Wikipedia dumps   Wikipedia is a superb resource for reference (taken with a pinch of salt of course). I spend hours at a time spidering through its pages and always come away amazed at how much information it hosts. In my opinion this ranks amongst the defining milestones of mankind’s advancement.

Apart ...

Word arithmetic puzzle generator

I was digging through some old code of mine when I came across this script. To me, this script was a demonstration of the beauty and elegance of the python language.

You might have come across a puzzle like this: AID + ICED = IDEA. What digits would you assign to the ...

Drawing on your Desktop

This is related to the previous post and is meant in part to demonstrate how great Linux is for doing “weird” stuff :). This is what we are trying to do.

desktop circle

The circles in the background have been ...

Matrix Desktop

Matrix Desktop

What you see above is how my desktop looks now. You need to be using gnome to get this working.

Nautilus draws the desktop (including the icons) for you in gnome by default. We have to tell ...

© Prashanth Ellina. Built using Pelican. Theme by Giulio Fidente on github.