How To Debug In Python

1 mainAs with all programming related tasks, debugging is an important part. If you are using an IDE, then you’ll have some kind debugging feature available. But most Python programmers like to use vim or any text editor to write code and then execute it from the terminal. So how can you debug in this situation? Whenever you are working on a project, it’s nice to have a set of tools that can be used to understand what’s happening during execution. Python has an inbuilt debugger called pdb, which stands for “Python DeBugger”. Big surprise, right? It’s a great tool to analyze your code. In this blog post, we’ll see how to use some of its most popular features. Let’s get started, shall we?   Continue reading “How To Debug In Python”

How To Install Valgrind On Mac OS X

mainAs your code gets bigger, keeping track of memory becomes critical. These things often become the source of huge crashes and annoying bugs. Detecting them manually is a very tedious process. So we need a tool to manage all this for us. This is where Valgrind comes into picture. Valgrind is a programming tool for memory debugging, memory leak detection, and profiling. It can be used to keep track of all the memory allocated at all stages in your program. Although it was initially meant to be a memory debugger, it has grown to become a generic framework for building dynamic analysis tools. You can use Valgrind to build new tools as well. There are Valgrind tools like Memcheck that can automatically detect many memory management and threading bugs, and profile your programs in detail. Valgrind is widely used in the industry and it’s well respected within the coding community. Let’s see how we can get it up and running on Mac OS X.   Continue reading “How To Install Valgrind On Mac OS X”

Python Development In Eclipse

As your code gets bigger, effective code management becomes an integral part of your project. This post is about setting up Python development environment in Eclipse. Most of the Python developers will already be aware of this. For those of you who are not, read on. Eclipse is an IDE which supports many different languages. It has plugins for various different frameworks as well. We will discuss about how we can set up everything from scratch. Once you set everything up, you will be able to run and debug you Python code easily. It provides many different options and it has a nice UI too.   Continue reading “Python Development In Eclipse”