How to find the mime type of a file in Python

A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) is a standard that indicates the nature and format of a document, file, or assortment of bytes. It is defined…

Read and write with file CSV in Python

[dropcap]I[/dropcap]t is possible to read and write CSV (comma separated values) files using Python 2.4 Distribution. Like most languages, file operations can be done with Python. Writing a CSV file with Python can be…

Column Edit Mode in VIM

Typing in column mode in editors is sometimes actually useful. How many times have you wanted to replace columns of text with something? You can do this utility with common…

How to use urllib in Python

[dropcap]T[/dropcap]oday, with the development of the internet, network programming to exchange packets is no longer as complicated as it was a few decades ago. Python is no exception when it…

How to loop a dictionary in Python

Dictionary is one of the most widely used data structures in programming, especially with Python. To understand how to loop on it, extract its keys as well as retrieve all…

Using Feedparser in Python to read RSS

In this post, we will take a closer look at how to fetch and parse syndicated feeds with Feedparser library in Python. The detailed documentation of this library can be…

Simple steps to log messages in Java programs using Log4j

This article explains a bit of the importance of application logging and log4j API in Java. The following paragraphs will give you an overview of how logging mechanism works in…

Running a simple http server

In the world of web engineering and development, developing web-based applications always need a web application server where all web pages are accommodated. Depending on what web technology as well…

Measure running time a routine in Python

I think this helps us a lot for estimation of how long a program runs in Python. When dealing with a huge amount of data, it takes long time. Showing…

Delete columns in numpy.array

a=array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) delete(a, s_[1:3], axis=0) # remove rows 1 and 2 output: array([[…