Real Python: How to Flatten a List of Lists in Python
Link: https://realpython.com/python-flatten-list/
Flattening a list in Python involves converting a nested list structure into a single, one-dimensional list. A common approach to flatten a list of lists is to use a for loop to iterate through each s
Link: https://realpython.com/python-flatten-list/
Flattening a list in Python involves converting a nested list structure into a single, one-dimensional list. A common approach to flatten a list of lists is to use a for loop to iterate through each s
Realpython
How to Flatten a List of Lists in Python – Real Python
In this tutorial, you'll learn how to flatten a list of lists in Python. You'll use different tools and techniques to accomplish this task. First, you'll use a loop along with the .extend() method of list. Then you'll explore other tools, including reduce()…
Real Python: Using Python's pip to Manage Your Projects' Dependencies
Link: https://realpython.com/what-is-pip/
pip is the standard package manager for Python, used to install and manage libraries that aren’t part of the Python standard library. You use pip to manage dependencies and install packages from the P
Link: https://realpython.com/what-is-pip/
pip is the standard package manager for Python, used to install and manage libraries that aren’t part of the Python standard library. You use pip to manage dependencies and install packages from the P
Realpython
Using Python's pip to Manage Your Projects' Dependencies – Real Python
What is pip? In this beginner-friendly tutorial, you'll learn how to use pip, the standard package manager for Python, so that you can install and manage packages that aren't part of the Python standard library.
Real Python: Working With JSON Data in Python
Link: https://realpython.com/python-json/
Python’s json module provides you with the tools you need to effectively handle JSON data. You can convert Python data types to a JSON-formatted string with json.dumps() or write them to files using j
Link: https://realpython.com/python-json/
Python’s json module provides you with the tools you need to effectively handle JSON data. You can convert Python data types to a JSON-formatted string with json.dumps() or write them to files using j
Realpython
Working With JSON Data in Python – Real Python
In this tutorial, you'll learn how to read and write JSON-encoded data in Python. You'll begin with practical examples that show how to use Python's built-in "json" module and then move on to learn how to serialize and deserialize custom data.
Real Python: Strings and Character Data in Python
Link: https://realpython.com/python-strings/
Python strings are a sequence of characters used for handling textual data. You can create strings in Python using quotation marks or the str() function, which converts objects into strings. Strings i
Link: https://realpython.com/python-strings/
Python strings are a sequence of characters used for handling textual data. You can create strings in Python using quotation marks or the str() function, which converts objects into strings. Strings i
Realpython
Strings and Character Data in Python – Real Python
In this tutorial, you'll learn how to use Python's rich set of operators and functions for working with strings. You'll cover the basics of creating strings using literals and the str() function, applying string methods, using operators and built-in functions…
Zato Blog: Using OAuth in API Integrations
Link: https://zato.io/en/blog/oauth-api-integrations.html
Using OAuth in API Integrations
2024-12-23, by Dariusz Suchojad
OAuth is often employed in processes requiring permissions to be granted to frontend applications and end users.
Yet, what we typ
Link: https://zato.io/en/blog/oauth-api-integrations.html
Using OAuth in API Integrations
2024-12-23, by Dariusz Suchojad
OAuth is often employed in processes requiring permissions to be granted to frontend applications and end users.
Yet, what we typ
Mike Driscoll: An Intro to pre-commit
Link: https://www.blog.pythonlibrary.org/2024/12/23/an-intro-to-pre-commit/
You can use many great tools to help you in your software development journey. One such tool is pre-commit, a framework for managing and maintaining multi-language pre-commit hooks. You use pre-commit
Link: https://www.blog.pythonlibrary.org/2024/12/23/an-intro-to-pre-commit/
You can use many great tools to help you in your software development journey. One such tool is pre-commit, a framework for managing and maintaining multi-language pre-commit hooks. You use pre-commit
Mouse Vs Python
An Intro to pre-commit - Mouse Vs Python
You can use many great tools to help you in your software development journey. One such tool is pre-commit, a framework for managing and maintaining
Real Python: How to Remove Items From Lists in Python
Link: https://realpython.com/remove-item-from-list-python/
Removing items from a Python list is a common task that you can accomplish with various techniques. Whether you need to remove an item by its position or value, Python has you covered. In this tutoria
Link: https://realpython.com/remove-item-from-list-python/
Removing items from a Python list is a common task that you can accomplish with various techniques. Whether you need to remove an item by its position or value, Python has you covered. In this tutoria
Realpython
How to Remove Items From Lists in Python – Real Python
In this how-to guide, you'll explore different ways to remove items from lists in Python. Using practical examples, like managing a library book list and a contact book application, you'll learn efficient techniques for handling list item removal.
Juri Pakaste: New Swift Package: provision-info
Link: https://juripakaste.fi/provision-info/
I released a new Swift library! provision-info is a Swift package for macOS. Its purpose is to parse and show information about provisioning profile files. There's a command line tool and Swift librar
Link: https://juripakaste.fi/provision-info/
I released a new Swift library! provision-info is a Swift package for macOS. Its purpose is to parse and show information about provisioning profile files. There's a command line tool and Swift librar
juripakaste.fi
New Swift Package: provision-info
Personal blog of Juri Pakaste
Juri Pakaste: New Swift Package: tui-fuzzy-finder
Link: https://juripakaste.fi/fuzzy-tui/
Speaking of new Swift libraries, I released another one: tui-fuzzy-finder is a terminal UI library for Swift that provides an incremental search and selection UI that imitates the core functionality o
Link: https://juripakaste.fi/fuzzy-tui/
Speaking of new Swift libraries, I released another one: tui-fuzzy-finder is a terminal UI library for Swift that provides an incremental search and selection UI that imitates the core functionality o
juripakaste.fi
New Swift Package: tui-fuzzy-finder
Personal blog of Juri Pakaste
Daniel Roy Greenfeld: TIL: run vs source
Link: https://daniel.feldroy.com/posts/til-2024-12-difference-between-run-and-source
Run
A run launches a child process in a new bash within bash, so variables last only the lifetime of the command. This is why launching Python environments doesn't use run.
./list-things.sh
Source
A
Link: https://daniel.feldroy.com/posts/til-2024-12-difference-between-run-and-source
Run
A run launches a child process in a new bash within bash, so variables last only the lifetime of the command. This is why launching Python environments doesn't use run.
./list-things.sh
Source
A
https://daniel.feldroy.com
TIL: run vs source
Different ways to run bash commands that explains part of my frustration with bash over the years.
Daniel Roy Greenfeld: TIL: Autoreload for Jupyter notebooks
Link: https://daniel.feldroy.com/posts/til-2024-11-autoreload-for-jupyter-notebooks
Add these commands to the top of a notebook within a Python cell. Thanks to Jeremy Howard for the tip.
%load_ext autoreload
%autoreload 2
Link: https://daniel.feldroy.com/posts/til-2024-11-autoreload-for-jupyter-notebooks
Add these commands to the top of a notebook within a Python cell. Thanks to Jeremy Howard for the tip.
%load_ext autoreload
%autoreload 2
https://daniel.feldroy.com
TIL: Autoreload for Jupyter notebooks
How to skip having to restart your notebook on code changes.
Daniel Roy Greenfeld: Using locust for load testing
Link: https://daniel.feldroy.com/posts/2024-11-using-locust-for-load-testing
Locust is a Python library that makes it relatively straightforward to write Python tests. This heavily commented code example explains each section of code. To use locust:
Install locust: pip instal
Link: https://daniel.feldroy.com/posts/2024-11-using-locust-for-load-testing
Locust is a Python library that makes it relatively straightforward to write Python tests. This heavily commented code example explains each section of code. To use locust:
Install locust: pip instal
https://daniel.feldroy.com
Using locust for load testing
Quickstart guide for doing web application load testing with the Python powered locust library.
Daniel Roy Greenfeld: TIL: Using Python to removing prefixes and suffixes
Link: https://daniel.feldroy.com/posts/til-2024-10-removing-prefixes-and-suffixes
Starting in Python 3.9, s.removeprefix() and s.removesuffix() were added as str built-ins. Which easily covers all the versions of Python I currently support.
Usage for removeprefix():
>>> 'Spam, Spam
Link: https://daniel.feldroy.com/posts/til-2024-10-removing-prefixes-and-suffixes
Starting in Python 3.9, s.removeprefix() and s.removesuffix() were added as str built-ins. Which easily covers all the versions of Python I currently support.
Usage for removeprefix():
>>> 'Spam, Spam
https://daniel.feldroy.com
TIL: Using Python to removing prefixes and suffixes
How did I miss these functions getting added to Python?
Daniel Roy Greenfeld: TIL: Using hx-swap-oob with FastHTML
Link: https://daniel.feldroy.com/posts/til-2024-12-using-hx-swap-oob-with-fasthtml
Until now I didn't use this HTMX technique, but today Audrey Roy Greenfeld and I dove in together to figure it out. Note that we use language that may not match HTMX's description, sometimes it's bett
Link: https://daniel.feldroy.com/posts/til-2024-12-using-hx-swap-oob-with-fasthtml
Until now I didn't use this HTMX technique, but today Audrey Roy Greenfeld and I dove in together to figure it out. Note that we use language that may not match HTMX's description, sometimes it's bett
https://daniel.feldroy.com
TIL: Using hx-swap-oob with FastHTML
How to have the injected content know where to go instead of assigning it from the form.
Daniel Roy Greenfeld: TIL: Arity
Link: https://daniel.feldroy.com/posts/til-2024-12-arity
I'm excited to have learned there's a word for the count of arguments to a function/method/class: arity. Throughout my career I would have called this any of the following:
number_of_args
param_count
Link: https://daniel.feldroy.com/posts/til-2024-12-arity
I'm excited to have learned there's a word for the count of arguments to a function/method/class: arity. Throughout my career I would have called this any of the following:
number_of_args
param_count
https://daniel.feldroy.com
TIL: Arity
In logic, mathematics, and computer science, arity is the number of arguments or operands taken by a function, operation or relation.
Daniel Roy Greenfeld: TIL: How to reset Jupyter notebook passwords
Link: https://daniel.feldroy.com/posts/til-2024-12-how-to-reset-jupyter-notebook-passwords
jupyter notebook password
Attribution for this goes to Johno Whitaker.
Link: https://daniel.feldroy.com/posts/til-2024-12-how-to-reset-jupyter-notebook-passwords
jupyter notebook password
Attribution for this goes to Johno Whitaker.
https://daniel.feldroy.com
TIL: How to reset Jupyter notebook passwords
For those times when you get locked out of a Jupyter notebook
Daniel Roy Greenfeld: TIL: Python's defaultdict takes a factory function
Link: https://daniel.feldroy.com/posts/til-2024-12-defaultdict-takes-a-factory-function
I've never really paid attention to this object but maybe I should have. It takes a single argument of a callable function. If you put in Python types it sets the default value to those types. For exa
Link: https://daniel.feldroy.com/posts/til-2024-12-defaultdict-takes-a-factory-function
I've never really paid attention to this object but maybe I should have. It takes a single argument of a callable function. If you put in Python types it sets the default value to those types. For exa
https://daniel.feldroy.com
TIL: Python's defaultdict takes a factory function
Create a dictionary-like object that takes a factory function so you have lots of control over what the default value can be.
Daniel Roy Greenfeld: TIL: Python Dictonary Merge Operator
Link: https://daniel.feldroy.com/posts/til-2024-11-python-dictonary-merge-operator
The function way
Until today I did this:
# Make first dict
num_map = {
'one': '1', 'two': '2', 'three': '3', 'four': '4',
'five': '5', 'six': '6', 'seven': '7', 'eight': '8',
'nine': '9'
}
Link: https://daniel.feldroy.com/posts/til-2024-11-python-dictonary-merge-operator
The function way
Until today I did this:
# Make first dict
num_map = {
'one': '1', 'two': '2', 'three': '3', 'four': '4',
'five': '5', 'six': '6', 'seven': '7', 'eight': '8',
'nine': '9'
}
https://daniel.feldroy.com
TIL: Python Dictonary Merge Operator
Did you know there's a merge operator for Python dictionaries? I didn't until today!
Daniel Roy Greenfeld: TIL: Fractional Indexing
Link: https://daniel.feldroy.com/posts/til-2024-11-fractional-indexing
In the past when I've done this for web pages and various other interfaces it has been a mess. I've built ungainly sort order in numeric or alphanumeric batches. Inevitably there is a conflict, often
Link: https://daniel.feldroy.com/posts/til-2024-11-fractional-indexing
In the past when I've done this for web pages and various other interfaces it has been a mess. I've built ungainly sort order in numeric or alphanumeric batches. Inevitably there is a conflict, often
https://daniel.feldroy.com
TIL: Fractional Indexing
How to keep order of records without having to update all the records
Daniel Roy Greenfeld: TIL: Making pytest use Ipython's PDB
Link: https://daniel.feldroy.com/posts/til-2024-11-making-pytest-use-ipython's-pdb
alias pdb='pytest --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb'
Usage:
pdb tests/test_things::test_broken_thing
Link: https://daniel.feldroy.com/posts/til-2024-11-making-pytest-use-ipython's-pdb
alias pdb='pytest --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb'
Usage:
pdb tests/test_things::test_broken_thing
https://daniel.feldroy.com
TIL: Making pytest use Ipython's PDB
Once I've isolated a test failure to a very small set of failures I use this instead of running pytest directly. What it does on exception is start the IPython pdb interface.