Explain Codes LogoExplain Codes Logo

Python

How to print a number using commas as thousands separators

python
functions
best-practices
performance

Delete multiple objects in django

python
django
model-form
csrf

How to dynamically load a Python class

python
dynamic-import
importlib
python-best-practices

Access an arbitrary element in a dictionary in Python

python
dataframe
collections
best-practices

Get key by value in dictionary

python
dataframe
pandas
collections

Use different Python version with virtualenv

python
virtualenv
python-versions
environment-management

Why use def main()?

python
best-practices
code-hygiene
debugging

How can I access environment variables in Python?

python
environment-variables
os-module
best-practices

How to create a zip archive of a directory?

python
zipfile
advanced-usage
python-modules

Print all properties of a Python Class

python
object-oriented-programming
data-serialization
pretty-printing

Find the similarity metric between two strings

python
string-similarity
python-stdlib
fuzzy-matching

How to serve static files in Flask

python
static-files
flask
web-development

How do I trim whitespace from a string?

python
string-manipulation
functions
best-practices

Explaining Python's '__enter__' and '__exit__'

python
context-manager
exception-handling
best-practices

How can I write a `try`/`except` block that catches all exceptions?

python
exception-handling
best-practices
logging

How do I move a file in Python?

python
file-handling
pathlib
file-movement

Call int() function on every list element?

python
list-comprehensions
map-function
memory-optimization

How to save a dictionary to a file?

python
serialization
data-serialization
pickle

Get the key corresponding to the minimum value within a dictionary

python
dataframe
list-comprehension
filter

How to change legend fontsize with matplotlib.pyplot

python
matplotlib
legend-customization
font-properties