How to Solve WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH?

Did you get the “β€˜geckodriver’ executable needs to be in PATH?” error message when running your Python program? Are you searching for the answers in Q& A programming websites? But are you confused about the solutions provided on their websites? Are their solutions not working to rectify the issues? If your answer is YES. You … Read more

Solidity Error Handling with assert(), require(), revert() – A Guide for Python Coders

In Solidity, you can use the require, revert, and assert functions to check error conditions and handle exceptions, but they look similar at first glance, and you might get confused about how to use them. This article will explain their differences, specifically to Python developers. We use a simple smart contract below, taken from the … Read more

How to Fix UnicodeDecodeError when Reading CSV file in Pandas with Python?

[toc] Introduction In general, encoding means using a specific code for the letters, symbols, and numbers. Numerous encoding standards that are used for encoding a Unicode character. The most common ones are utf-8, utf-16, ISO-8859-1, latin, etc. For example, the character $ corresponds to U+0024 in utf-8 standard and the same corresponds to U+0024 in … Read more

How to Log a Python Error with Debug Information?

[toc] Generally, logging is an extremely valuable tool in a software developer’s toolbox. Logging helps to assist you with the flow of a program and find situations that you probably would not have considered while coding. By logging useful data and information, you can troubleshoot the errors effectively as well as utilize the information to … Read more

Pytest – A Complete Overview

Pytest is a popular test framework in Python. It helps to automate the test execution process and run unit tests as frequently as possible with minimal effort.  Everyone who has at least some experience with computer programming would intuitively know that testing is critical when building a software application. But beginners often find it difficult … Read more

[Solved] AttributeError: can’t set attribute in python

Problem Formulation You create a namedtuple object in your code and you want to overwrite one of the attribute values like you’re used to for normal objects: But, unexpectedly, Python raises an AttributeError: can’t set attribute. ? What can you do? ? Let’s understand the reason this error occurs—after that, you’ll learn the best fixes. … Read more

How to Print the Exception Without Exiting Your Python Program?

Problem Formulation Given a basic Python program. How to print an exception if it occurs without exiting the program? For example, consider the following program that raises a ZeroDivisionError: division by zero. The output is: You want the program to keep running and executing the print statement after giving you a note about the exception: … Read more