How to create a simple logger in Python, second part

As I explained in the first part of ‘How to create a simple logger’ in Python series, logging is a very important aspect of software development, especially for the professional software developer. Although a junior Python developer, there is a project which I am coding in which I need to make use of the Python’s logging builtin module.
Continue reading “How to create a simple logger in Python, second part”

How to access the elements of a generator object in Python

A generator object in the Python computer programming language is totally different from a normal function, as it returns multiple values one by one through the yield statement.

As you may already know, a normal function in Python returns one value to the caller through the return statement. One can easily access the value returned by the normal function just by calling it. Continue reading “How to access the elements of a generator object in Python”

What is the main difference between an absolute and a relative path on Unix based systems

Those who have made use of the cd command through a terminal application on their own operating system, have probably made use of a relative path, an absolute one or both of them. Based on my personal experience with the command line, the cd command is a Unix based one and it helps the user to navigate their filesystem through the terminal application. The cd command takes the path of the file as an argument.

For example, the following command helps the user to change their current working directory to the Desktop.

Continue reading “What is the main difference between an absolute and a relative path on Unix based systems”

A practical case of an error class in Python

Many beginners of the Python computer programming language have a difficulty in understanding custom error classes; especially when they want to make use of them in their projects.

I am writing this article with the main purpose of giving a practical example of an error class which I am making use of in a personal project.
Continue reading “A practical case of an error class in Python”

Ten Unix commands you should periodically try on your terminal application

Those who are familiar with the terminal application part of Unix based systems, have probably done some work with the help of it. Being a terminal user for some time now, I automate a lot of stuff on my Mac OS X operating system by making use of such a wonderful computer utility.

Although the graphical user interfaces offered by the modern computer operating systems out there make the terminal application seem like a nightmare to the beginner computer user, based on my personal experience I am completely sure that by guiding one through the right path of becoming a command line user, terminal becomes their first choice when interacting with their own operating system of choice. Continue reading “Ten Unix commands you should periodically try on your terminal application”

Introduction to the Python os.walk function with a practical example

Being rich in features, the Python computer programming language offers to the coder many utilities which they can make use of to automate almost any kind of task in their operating system. Although the Python technology offers all kinds of modules in its standard library, I never truly liked its official documentation. Not that I hate it, but I don’t find it very user friendly, especially for the complete novice coder.

As far as my experience goes with the Python’s official documentation, I can assure you that there are not many concrete examples in there. Continue reading “Introduction to the Python os.walk function with a practical example”

How to create a simple logger in Python, first part

The Python computer programming language offers a builtin module which can be utilized to log applications. Being a junior developer, lately I have started to realize the importance of logging.

Before one can properly make use of the Python’s builtin logging module, they need to learn the basics. Through this tutorial, the reader is going to learn how to create a simple logger with the help of the Python’s builtin module, so they can build some basic foundation which can be useful later in their serious projects. Continue reading “How to create a simple logger in Python, first part”