Explain Codes LogoExplain Codes Logo

Python

What are the most common Python docstring formats?

python
docstring
python-8
type-hinting

How to fix "Attempted relative import in non-package" even with __init__.py

python
relative-imports
python-modules
package-structure

How to convert SQLAlchemy row object to a Python dict?

python
sqlalchemy
data-types
performance

How do I install pip on macOS or OS X?

python
venv
pip
installation

How do I make a flat list out of a list of lists?

python
functions
performance
best-practices

How to make IPython notebook matplotlib plot inline

python
matplotlib
ipython
plotting

How do I clone a Django model instance object and save it to the database?

python
clone
django
model

Python 3: UnboundLocalError: local variable referenced before assignment

python
unboundlocalerror
global-variables
nonlocal-variable

How to find MIME types in Python?

python
mimetype
file-handling
web-development

Permanently add a directory to PYTHONPATH?

python
venv
best-practices
python-8

Is it possible to ignore one single specific line with Pylint?

python
linting
pylint
code-quality

How can I delete a file or folder in Python?

python
file-deletion
pathlib
file-handling

Cannot switch Python with pyenv

python
prompt-engineering
best-practices
virtual-environments

How to determine a Python variable's type?

python
type-checking
variable-types
python-internals

Behaviour of increment and decrement operators in Python

python
increment
assignment-expressions
best-practices

Can I set max_retries for requests.request?

python
retry-strategy
requests-library
resilience

Append integer to beginning of list in Python

python
list-manipulation
performance
best-practices

How to check if type of a variable is string?

python
functions
best-practices
collections

How do I call a parent class's method from a child class in Python?

python
method-resolution-order
multiple-inheritance
class-hierarchies

Save plot to image file instead of displaying it

python
matplotlib
image-processing
plotting