Articles in the Python category

How to debug with logging

Many developers often use print statements for debugging their code. Print statements are a good way to trace and troubleshoot potential...

Create self contained python executables

Every one knows the special file __init__.py. There is another special file __main__.py. If this file exists in a directory, the python...

Concatenation of strings in Python

Most Python books or blog posts, teach us that concatenating strings using the + sign is a bad idea. This is true: using + or =+ is a...

Python descriptors

Python descriptors have been around for a long time, but probably because of the lack of good documentation they are still not widely...

Managing records in python

A simple way to access data from a file or from a database is to read each line or row, then assign each value to a list or a tuple. The...

Optimizing your code with __slots__

Python like many other dynamic programming languages can be extended. Objects and definitions can be modified at runtime. This gives the...

Heartbeat Code For Cluster Environment

Working in a cluster environment, I often need to check if some of the nodes of my cluster are dead or live. To do so, I have a class...


Page 1 / 2