Practical solutions

Python How-To's How-To Guides

Solve the problem. Keep building. The collection of Python-related howtos

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Plot Decision Boundary PythonThis article demonstrates to plot a decision boundary separating two classes in Python using the matplotlib library. How to Get Cookie Using Python SeleniumThis article demonstrates getting cookies from a website using the powerful web automation tool known as Selenium. How to Process Real-Time Audio in PythonThis post focuses on explaining the different steps involved in creating a real-time audio processing python. You can use the PyAudio library for this purpose. Let's discuss the detail of real-time audio processing in Python in this article. How to Downsample Python ArrayThere are several methods like slicing, block means, and interpolation that is used to resize an image in Python. How to Check if File Is Empty in PythonWe will learn how to check whether files are empty or not. We also have a look at different issues that were raised while checking an empty file in Python. How to Convert Integer to Roman Numerals in PythonThis tutorial will teach you to convert an integer to Roman numerals in Python. How to Convert Image to YUV Using OpenCVIn this article, we will see what is YUV and how to implement the YUV color model on an image using OpenCV. How to Check if the Generator Is Empty in PythonThis article discusses how to check if a generator is empty in Python. How to Create Python Script to Open a New Terminal and Run Commands in LinuxThis article focuses on the various method to open a new terminal and pass Linux command by creating a Python script. The first example uses a variable to save the command that needs to get passed. The second example explains how to add a sleep timer to a new terminal and how to keep it alive. In a subsequent example, a safer method to pass Linux commands to a new terminal using subprocess() is explained. How to Convert Roman Numerals to Integers in PythonThis article discusses how to convert roman numerals to integers in Python. We will use Python if statements to do this. We will also explore a few more ways to change roman numerals to integers in Python. How to Validate Numbers Using Luhn Algorithm in PythonThis article explains the concept of validation numbers using the luhn algorithm in Python. The article has three examples, the first one is a pure procedural program using lists and slicing operators to implement the luhn algorithm. The second algorithm uses just loops to implement the luhn algorithm. The third example uses a functional program to implement the luhn algorithm in Python. The Short Circuit Evaluation in PythonThis tutorial demonstrates how does Python support short-circuiting. How to Import Multiple CSV Files Into Pandas and Concatenate Into One DataFrameThis tutorial demonstrates how to import multiple CSV files using Pandas and concatenate them into single DataFrame. How to Accept Timeout in Python SocketThis article discusses the socket accept timeout in Python socket programming. How to Fix ZeroDivisionError: Float Division by Zero in PythonWe will demonstrate how to resolve zero division error in Python. How to Peek Heapq in PythonWe can use the heap[0] notation, the heappop() function, and the nsmallest() function to peek at the smallest element of a heap in Python. How to Convert Hex to Base64 in PythonWe can use the codecs, or the base64, or the binascii modules to convert a hex string into a base64 string in Python. How to Fix IndexError: Tuple Index Out of Range in PythonWe will demonstrate how to resolve tuple index out of range error in Python. How to Fix the TypeError: 'float' Object Cannot Be Interpreted as an Integer in PythonWe will demonstrate how to resolve float object cannot be interpreted as an integer error in Python. How to Fix the TypeError: Object of Type 'Int64' Is Not JSON SerializableWe will demonstrate how to resolve the object of type int64 is not JSON serializable error in Python. How to Fix SSL CERTIFICATE_VERIFY_FAILED Error in PythonThis tutorial discusses how to Fix SSL CERTIFICATE_VERIFY_FAILED Error in Python. Description unavailable. How to Split String Based on Multiple Delimiters in PythonHow to split a string into a list in Python 2.7/Python 3.x based on multiple delimiters/separators/arguments or by matching with a regular expression. It includes regular expression and string replace methods. How to Check a String Contains a Number in PythonPython any function together with str.isdigit could check whether a string contains a number or not; re.search function checks a string contains a number even faster than the above solution.