Sathiya Sarathi Gunasekaran
Pythonist 🐍| Linux Geek who codes on WSL | Data & Cloud Fanatic | Blogging Advocate |
Python: Remove the Prefix and Suffix From a String
There are multiple ways to remove whitespace and other characters from a string in Python. The most commonly known methods are strip(), lstrip(), and rstrip(). Since Python version 3.9, two highly anticipated methods were introduced to remove the prefix or suffix of a string: removeprefix() and removesuffix(). In this...
Guide to Python's strip() Method
String manipulation in Python is achieved through a set of built-in methods, which return new strings since they're immutable. In this guide, we will look at methods to strip whitespace (in other languages it's also known as trimming) from strings in Python. Trim Methods - strip() In Python, the stripping...
Redis Queues & Redis Queue Dashboards for Python API Development
The in-memory data store - Redis is extensively used by developers as a database, cache layer, to manage job queues, and more. It comes in handy when you are building APIs with a job queue mechanism to handle tasks like running memory-intensive jobs in the background, counting page visits, or...
Guide to Elasticdump - Moving and Saving Elasticsearch Indices
Elasticsearch initially began as a custom search engine. These days, it has gone above and beyond that singular role as it's part of log aggregation stacks, security monitoring, and even as a datastore for performing exploratory analysis. Indices in Elasticsearch is where the data is stored, and there are often...
Checking Vulnerabilities in Your Python Code with Bandit
As developers, we're encouraged from the start of the journey to write clean code. Equally as important, but less talked about is writing and using secure code. In Python projects, we typically install modules and third-party packages to avoid developing solutions that already exist. However, this common practice is why...
How to Install Pip on Windows
Package managers are tools commonly created for programming languages that make the setup and management of third-party packages easier. Pip is the preferred package manager in Python for both the native Pip modules and the ones installed inside the virtual environments. When Pip is invoked, it automatically crawls against the...
Guide to Understanding chmod
File access permissions and security are at the heart of *nix-based operating systems. File objects can belong to users and/or groups, and at times they need to be shared with various combinations of those two. There are multiple ways in *nix systems to reinforce secure sharing of these objects....
How to Concatenate String Variables in Bash
Bash utilities make so many tasks simple, but not all tasks have a straightforward command or operator. A very common and usual task in many scripting scenarios is concatenating string variables. Bash doesn't have a built-in function or command-line utility to concatenate two strings together. However, there are many ways...
How to Print Colored Text in Python
It's typical for CLI apps to return text in the same color of the terminal. There are always cases when we want to highlight output to the user, for example, a warning or error message. In those cases, a dash of color could make a difference. This article shows you...