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 Solve Urllib HTTP Error 403 Forbidden Message in PythonThis tutorial explains how to prevent an HTTP Error 403 forbidden message when using the urllib module. How to Solve the ValueError: I/O Operation on Closed File in PythonThis article provides three major examples of how the I/O Valueerror is caused and what are the various ways through which this error can be solved. How to Solve the NameError: Global Name 'unicode' Is Not Defined in PythonThis article discusses the causes and solutions for the NameError: Global name 'unicode' is not defined error in Python. How to Solve ModuleNotFoundError in PythonThis tutorial describes how to solve ModuleNotFoundError when working with Python modules. How to Solve IndexError: Arrays Used as Indices Must Be of Integer (Or Boolean) TypeThis tutorial describes how to solve IndexError: arrays used as indices must be of integer (or boolean) type in Python. How to Solve Error - Python.h: No Such File or Directory in C++This article explains the steps involved in installing Python through a custom installation, installing Visual Studio, linking the include and libs folder from the Python directory to Visual Studio. Lastly, a program is compiled to display that the error is solved. How to Solve Configure: Error: No Acceptable C Compiler Found in $PATHThis tutorial describes how to solve configure: error: no acceptable C compiler found in $PATH error message when installing Python in Linux. How to Solve AttributeError: 'list' Object Attribute 'append' Is Read-OnlyThis tutorial describes how to solve AttributeError when working with the list data type in Python. How to Fix TypeError: __str__ Returned Non-String but Printing OutputThis tutorial demonstrates how to remove the type error str returned non-string in Python. How to Fix ModuleNotFoundError: No Module Named ConfigparserIn this article we will learn what is the error ModuleNotFoundError: No module named Configparser, why does it occur and how to resolve this error. How to Fix ConnectionRefusedError: [Errno 111] Connection RefusedIn this article, we will learn what is the ConnectionRefusedError, basically this error indicates that the client is unable to connect to the port on the system running the server script. How to Use Pickle to Save and Load Objects in PythonThis article explains how we can save the objects using the Python Pickle module and load it again for later use. How to Fix Python ValueError: Unknown Label Type: 'continuous'The article discusses the valueError that is an unknown label type continuous and the potential solutions to this error and explains why it occurs. How to Define an Infinite Value in PythonWe will learn, with this explanation, what is an infinite value in Python and why we use an infinite value. We also go to learn how we can define an infinite value with the help of different ways in Python. The sprintf() Function in PythonThis article speaks about the Python sprintf and demonstrates how to format a string using different approaches. How to Use of defaultdict in PythonThis article describes the defaultdict and demonstrates its uses via code examples in Python. How to Fix ConnectionRefusedError: [Errno 61] Connection Refused in PythonThis tutorial will discuss ConnectionRefusedError in Python. How to Calculate Edit Distance in PythonThis article demonstrates edit distance in Python using insertion, deletion, substitution, and recursive implementation of the character string. How to Send an Email With Attachments in PythonThis tutorial teaches how to send an email with attachments using Python. How to Read gzip File in PythonThis tutorial highlights the importance of compressing a file and demonstrates how to compress and decompress using gzip in Python. How to Parse JSON Array of Objects in PythonThis tutorial demonstrates how to parse JSON array of objects in Python. How to Wait 5 Seconds in PythonThis tutorial discusses how to wait 5 seconds in Python. How to Match Fuzzy String in PythonThis article demonstrates how to use thefuzz library that allows us to do fuzzy string matching in python. We'll also learn how to use the process module that allows us to match or extract strings efficiently with the help of fuzzy string logic. How to Execute Shell Command and Get Output in PythonIn this article, we will learn how to execute cmd commands from a Python script with the help of os.system(). We will also learn how we can execute cmd commands from the script in an easier way with the help of the subprocess module in Python.