Planet Python RSS
217 subscribers
16.7K links
Unofficial Planet Python RSS feed from planetpython.org. Maintained by @cfinnberg
Download Telegram
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
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
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
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
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
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
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
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
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
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
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'
}
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
Daniel Roy Greenfeld: TIL: SequentialTaskSet for Locust

Link: https://daniel.feldroy.com/posts/til-2024-11-sequentialtaskset-for-locust

SequentialTaskSet makes it so Locust tasks happen in a particular order, which ensures your simulated users are clicking around in a more human manner at a more human pace. Attribution goes to Audrey
Python Bytes: #415 Just put the fries in the bag bro

Link: https://pythonbytes.fm/episodes/show/415/just-put-the-fries-in-the-bag-bro

<strong>Topics covered in this episode:</strong><br>

<ul>
<li><a href="https://github.com/dbos-inc/dbos-transact-py?featured_on=pythonbytes"><strong>dbos-transact-py</strong></a></li>
<li><strong><a
Django Weblog: Welcome to our new Django accessibility team members - Eli, Marijke, Saptak, Tushar

Link: https://www.djangoproject.com/weblog/2024/dec/24/welcome-new-django-accessibility-team-members/

Sarah Abderemane, Thibaud Colas and Tom Carrick are pleased to introduce four new members in the Django Accessibility team ❤️.

Marijke Luttekes
Eliana Rosselli
Tushar Gupta
Saptak Sengupta

Marijke (
Talk Python to Me: #490: Django Ninja

Link: https://talkpython.fm/episodes/show/490/django-ninja

If you're a Django developer, I'm sure you've heard so many people raving about FastAPI and Pydantic. But you really love Django and don't want to switch. Then you might want to give Django Ninja a se
PyCoder’s Weekly: Issue #661 (Dec. 24, 2024)

Link: https://pycoders.com/issues/661

#661 – DECEMBER 24, 2024 View in Browser » Exploring Modern Sentiment Analysis Approaches in Python What are the current approaches for analyzing emotions within a piece of text? Which tools and