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 Convert Python Object to IteratorThis article discusses the idea of iterators in Python and converting an object to iterator using the __iter__() and __next__() method. kwargs in PythonThis tutorial discusses the kwargs feature in Python. How to Decode URL in PythonThis tutorial discusses the different methods on how to decode a URL in Python. The Mixin Classes in PythonThis tutorial discusses the mixin class feature in Python. How to Read Video in OpenCVThis article discusses reading a video using the VideoCapture() function of OpenCV in Python. How to Detect Line in Python OpenCVThis article discusses detecting lines in an image using the HoughLines() and HoughLinesP() function of OpenCV in Python. How to Datetime Objects With Timezone in PythonThis guide helps you understand Python's datetime module, how you can use it to work with dates and times, and how to spot and create timezone-aware objects in Python. How to Implement Depth-First Search in PythonThis tutorial demonstrates depth first search with its code using both recursive and iterative approach in Python. How to Install Python on LinuxThis tutorial demonstrates how to install Python on Linux. How to Combine Images in OpenCVThis tutorial will discuss combining two images using the concatenate() function of NumPy in Python. How to Calculate Average Color of Image in OpenCVThis tutorial will discuss finding the average color of an image using the average() function of NumPy in Python. The NetworkX Package in PythonThis tutorial demonstrates the use of Python NetworkX package to study complex networks. How to Use Erode in OpenCVThis tutorial will discuss finding the erosion of an image using the erode() function of OpenCV. How to Plot Confusion Matrix in PythonThis article discusses how we can plot a confusion matrix in Python. We use the matplotlib module, Seaborn module, and pretty confusion matrix module in Python. How to Implement Curl Commands Using Requests Module in PythonIn this article, you will learn how to implement curl commands using the Requests module in Python. We discussed the Get, Post, Put, and Delete curl commands. How to Take Input of Unspecified Length in PythonIn this tutorial, we will see how we can take inputs in Python when we don't know the input length. We will see how this is done using the while loop, sys module, and a function that works like the cin statement of C++. How to Pass a List to a Function in PythonThis article discusses how we can pass a list to a function in Python. We will also see how passing a list to a function in Python is different from unpacking a list. How to Implement Memoization in PythonThis tutorial discusses Memoization and how to implement them in Python. How to Compress and Decompress Data Using Zlib in PythonThis tutorial discusses the methods to compress and decompress data with the zlib module in Python. How to Multiply List by Scalar in PythonThere are three main methods that can be used to multiply each element of a list with a scalar quantity; the list comprehensions, the map() function, and the lambda functions in Python. How to Handle NameError Exception in PythonThis tutorial discusses the reasons for the NameError exception and how we can handle it in Python. How to Decode Base-64 Data in PythonThis article explains the concept of Base64 and decoding, presented step-by-step along with its functional codes and practical examples, including image decoding. How to Create Pipelines in PythonThis article mainly focuses on how pipelines in Python are created for sklearn datasets and custom datasets. How to Use SCP Protocol in PythonThis tutorial discusses the use of Secure Copy Protocol with Python.