How to find a pattern with re.search in a Python string

Regular expressions are very useful to the Python geek, especially when they have to deal with a lot of data which comes in the form of text. Being very rich in features, the Python computer programming language comes with a builtin module which offers the functionalities and utilities to construct regular expressions based on the coder’s needs. Continue reading “How to find a pattern with re.search in a Python string”

How to pass **kwargs inside a Python function

In one of the previous tutorials about the Python computer programming language, we learned how to make use of the *args syntax to pass arguments inside a function. Through this article, you are going to learn how to make use of the **kwargs Python syntax to automatically pass keyword based arguments inside a function.
Continue reading “How to pass **kwargs inside a Python function”

How to override a method in a Python class

The class utility offered by the Python computer programming language, is a very important tool to the Python coder as it offers a way to develop custom extension classes which inherit attributes from a base one. By using the class utility offered by the Python computer programming language, the developer can easily get the most out of the object oriented programming concept. Continue reading “How to override a method in a Python class”

How to find your Python version the geek way

As a computer geek, I like to experiment with different command line utilities with the main purpose of finding new ways to automate daily tasks in my own operating system. Python is one of my favorite computer tool so far, as not only it helps me to write my custom utilities, but is also easy to read and understand.

Through this article, you are going to learn how you can find the version of Python which is installed in your own machine. There are many ways to accomplish such task, but for the purpose of this tutorial I am going to share the two I know. Continue reading “How to find your Python version the geek way”

How to execute commands of the unix based operating system in Python

Every operating system I am aware of comes with a command line utility through which the wise computer geek can execute commands and interact with the functionalities provided by it. Based on my personal experience with computers so far, Unix based machines offer a terminal utility to help the user run specific builtin commands which interact with the goodies offered by the operating system. On the other hand, Windows based machines come with what is known as CMD, similar to the terminal tool offered in Unix based operating systems.

Both the Unix terminal and the Windows CMD utilities, are being built to help the computer nerd get the most out of their own operating system. Before one can fully make use of these utilities, they should learn about the scripting language supported by them. Continue reading “How to execute commands of the unix based operating system in Python”

How to pass *args in a Python function

Functions are very useful in the Python computer programming language as they help the coder to group utilities together with the main purpose of accomplishing a specific goal. Not only this, but the function can also help the Python coder to stop repeating themselves in their Python based projects. Continue reading “How to pass *args in a Python function”

How to print the elements of a list object in Python

The Python list object is very useful to the coder, especially when they have to store data and keep track of it in their projects. Not only can the coder make use of the list object to store data in it, but they can also make use of the data by using different utilities which the Python computer programming language offers by default.
Continue reading “How to print the elements of a list object in Python”