Explain Codes LogoExplain Codes Logo

Python

Sort a list of tuples by 2nd item (integer value)

python
functions
performance
best-practices

How to check if a float value is a whole number

python
precision-engineering
float-comparisons
python-3.5

Python integer incrementing with ++

python
incrementing
pythonic-way
best-practices

How do I look inside a Python object?

python
object-introspection
python-objects
attribute-access

How to call a Python function from Node.js

python
child-process
async-await
promises

Starting python debugger automatically on error

python
prompt-engineering
debugging
exception-handling

What is the purpose of "pip install --user ..."?

python
pip-install
python-packages
virtual-environments

How do I remove/delete a folder that is not empty?

python
file-operations
exception-handling
directory-deletion

How can I find all matches to a regular expression in Python?

python
regex
finditer
match-objects

Is there a way to run Python on Android?

python
mobile-development
cross-platform
android-apps

Finding local IP addresses using Python's stdlib

python
networking
stdlib
ip-address

How can I compare two lists in python and return matches

python
list-comparison
data-structures
performance-testing

Why am I seeing "TypeError: string indices must be integers"?

python
json-parsing
data-types
error-handling

How to subtract a day from a date?

python
datetime-module
dateutil-realtivedelta
pendulum-library

How to properly assert that an exception gets raised in pytest?

python
pytest
exception-handling
testing

How to convert string representation of list to a list

python
prompt-engineering
data-sanitization
error-handling

How can I call a function within a class?

python
method-chaining
self
super

Does Python have “private” variables in classes?

python
encapsulation
best-practices
object-design

How do I fix 'ImportError: cannot import name IncompleteRead'?

python
importerror
pip-installation
environment-setup

What is the difference between __init__ and __call__?

python
functions
design-patterns
object-oriented-programming