Blog

Page 624 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for What"s the correct way to convert bytes to a hex string in Python 3?
pythonpython-3.x

What"s the correct way to convert bytes to a hex string in Python 3?

Published on September 2, 2023

## πŸ’‘ Converting Bytes to Hex String in Python 3: The Ultimate Guide If you've ever found yourself struggling with converting bytes to a hex string in Python 3, don't worry, you're not alone! This is a common issue that many developers encounter. In this

Cover Image for NameError: global name "xrange" is not defined in Python 3
pythonpython-3.xrange

NameError: global name "xrange" is not defined in Python 3

Published on September 2, 2023

# πŸ’» Demystifying the NameError: global name 'xrange' is not defined in Python 3 Are you stuck with the dreaded `NameError: global name 'xrange' is not defined` error while running a Python program? Don't worry, you're not alone! This common issue often f

Cover Image for Is __init__.py not required for packages in Python 3.3+
packagepythonpython-3.x

Is __init__.py not required for packages in Python 3.3+

Published on September 2, 2023

πŸ“Is __init__.py not required for packages in Python 3.3+?πŸ€” Hey there! Today, we're diving into the world of Python packages and discussing whether the `__init__.py` file is still required in Python 3.3+ πŸπŸ’Ό You might have come across some confusion wh

Cover Image for How to specify "nullable" return type with type hints
pythonpython-3.x

How to specify "nullable" return type with type hints

Published on September 2, 2023

# How to Specify "Nullable" Return Type with Type Hints πŸ˜•πŸ” Are you in a pickle πŸ₯’ and wondering how to specify the return type for something that can be `None`? Have no fear, because we've got you covered! 😎 In this blog post, we'll address this common

Cover Image for What"s the difference between `raw_input()` and `input()` in Python 3?
pythonpython-3.x

What"s the difference between `raw_input()` and `input()` in Python 3?

Published on September 2, 2023

# Raw Input vs Input: Demystifying Python 3 Are you a budding Python developer or an aspiring coder looking to master the basics of Python 3? One question that often confuses beginners is the difference between `raw_input()` and `input()` in Python 3. πŸ€”

Cover Image for Python 3 ImportError: No module named "ConfigParser"
pythonpython-3.x

Python 3 ImportError: No module named "ConfigParser"

Published on September 2, 2023

# How to Fix Python 3 ImportError: No module named 'ConfigParser' So you're trying to install the MySQL-python package using pip, but you encountered an ImportError with the message "No module named 'ConfigParser'". Don't worry, I've got you covered! In t

Cover Image for Python "raise from" usage
exceptionpythonpython-3.xsyntax

Python "raise from" usage

Published on September 2, 2023

πŸ“’πŸ Python "raise from" Usage: Understanding the Difference! πŸ€” So, you're curious about the difference between the `raise` and `raise from` statements in Python? πŸ€·β€β™€οΈ Don't worry, I'll break it down for you! πŸš€ Let's start by looking at the code snipp

Cover Image for "Unicode Error "unicodeescape" codec can"t decode bytes... Cannot open text files in Python 3
pythonpython-3.xunicode

"Unicode Error "unicodeescape" codec can"t decode bytes... Cannot open text files in Python 3

Published on September 2, 2023

# Unicode Error "unicodeescape" codec can't decode bytes... Cannot open text files in Python 3 **Are you facing a Unicode error when trying to open a text file in Python 3?** πŸ˜• Don't worry, you're not alone! Many developers have encountered this frustra

Cover Image for Relative imports - ModuleNotFoundError: No module named x
packagepythonpython-3.xpython-import

Relative imports - ModuleNotFoundError: No module named x

Published on September 2, 2023

πŸ“ **Title:** Mastering Relative Imports in Python 3: Solving the ModuleNotFoundError πŸ’₯ **Introduction** Python 3 can be a bit tricky to navigate, especially if you're used to Python 2. One common issue that often arises is the dreaded `ModuleNotFoundEr

Blog | Matheus Mello