This article will discuss best practices for parsing dates and getting a specific month, day, or year in the past or the future.
Continue readingAuthor Archives: Kiprono Koech
Python Class Object Is Not Callable
A callable object in Python is an object that can be called explicitly initiated to execute. If we attempt to call a not callable function, we run into this kind TypeError message.
Continue readingReplace Single Quotes With Double Quotes in Python
In Python, strings are enclosed with single or double-quotes. Single quotes can be replaced with double quotation marks and vice versa in Python using any of the following methods:
Continue readingConvert HEX to RGB and HSV in Python
The three-color models are RGB, HSV, and HEX. RGB stands for Red, Green, and Blue. HSV stands for Hue, Saturation, and Value. HEX is a hexadecimal representation of RGB values.
Continue readingReplace Forward Slash With Backslash in Python
A forward-slash (/) in a Python string can be replaced by a backslash (\) using the String replace() function, translate() method, or regular expression(re.sub()).
Continue readingMake Python Wait For a Pressed Key
In this article, we will discuss how to pause the execution of Python code until a given key is pressed. This concept can be useful to simply pause Python execution or impose conditions on the code implementation. There are three ways to do this:
Continue readingFix NameError Name is Not Defined
This Python error may occur because you are trying to create an array but not importing necessary packages accordingly, or the variable/identifier being accessed has not been defined in the code.
Continue readingRun Background Process in Python
Background processes are computer processes that run behind the scenes. The core advantage of running processes in the background is that you can do other tasks in the foreground. In this article, we will discuss how to run background processes using Python. We will also discuss how to check and stop running processes/applications.
Continue readingRun Batch File in Python
A batch file is a script that contains a series of commands saved as plain text and can be executed on MS-DOS. It can be saved with .bat or .cmd extension. This article will discuss how batch files can be executed using Python.
Continue reading