As the name suggests, it is a Python environment which is isolated from other python environments. This kind of environment is really handy when you are working on multiple projects but you don’t want to affect other project environments. Advantages of virtual environment. Isolated environment: It creates a self-contained Python instance. Whatever Python packages are […]

, ,

We often need command to recursively delete files from the current and sub-directories. Most of us execute the following command to do so. But to our utter surprise we find that it does not delete files from sub-directories. Well “r” option works only when you want to delete the directory. Use the following command to […]

,

Programmatically sending an email is really a good tool for developer’s paraphernalia. This is really handy when one automates task and wants to get notified by an email for success or failure. Lately I have written Python script to automate some jobs and incorporated method to send email notification. I thought to share this simple […]

, ,

I had used MySQLdb in past to interface with MySQL database. Most of the time I had used cursorclass=MySQLdb.cursors.DictCursor for getting the result as dictionary but today I wanted to get the results in tuples so I used cursorclass=MySQLdb.cursors.CursorTupleRowsMixIn. But when I execute it, it failed and complained about cursor() method call. The exception is […]

, , ,

In code development, be it one or the other requirement, we need to access the environment variable. In this post, the environment variable will be read/set in 5 different programming languages. C language In C, environment variables can be read and set by getenv() and putevn() methods respectively. The example code is shown below. Java […]

, , ,

A little while ago I was trying to port my blogs from Blogger.com to code4reference.com. But when I tried to port the blog, I noticed that the code section of my blog contained <br/> HTML tags for new line. When I used the the Syntaxhighlighter, the view was awful since the Syntax highter expects the […]

, ,