Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

Similar Podcasts

24H24L

24H24L
Evento en línea, de 24 horas de duración que consiste en la emisión de 24 audios de diversas temáticas sobre GNU/Linux. Estos son los audios del evento en formato podcast.

2.5 Admins

2.5 Admins
2.5 Admins is a podcast featuring two sysadmins called Allan Jude and Jim Salter, and a producer/editor who can just about configure a Samba share called Joe Ressington. Every two weeks we get together, talk about recent tech news, and answer some of your admin-related questions.

The Infinite Monkey Cage

The Infinite Monkey Cage
Brian Cox and Robin Ince host a witty, irreverent look at the world through scientists' eyes.

#414 Because we are not monsters

December 16, 2024 00:29:45 5.41 MB ( 16.15 MB less) Downloads: 0

Topics covered in this episode: New project to shorten django-admin to django because we are not monsters django-unicorn: The magical reactive component framework for Django Testing some tidbits The State of Python 2024 article Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky) Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: New project to shorten django-admin to django because we are not monsters Jeff Tripplet has created django-cli-no-admin to shorten django-admin to just django. “One of the biggest mysteries in Django is why I have to run django-admin from my terminal instead of just running django. Confusingly, django-admin has nothing to do with Django’s admin app.” Instead of typing things like: django-admin startproject mysite projectname We can type the shorter: django startproject mysite projectname I love this kind of developer speedup / comfort improvements And yes, Jeff wants Django to eventually include this as the default way to run the command line utilities. Michael #2: django-unicorn: The magical reactive component framework for Django Add modern site functionality: Quickly add in simple interactions to regular Django templates without learning a new templating language. Skip the JavaScript build tools No API required: Skip creating a bunch of serializers and just use Django. Brian #3: Testing some tidbits Ned Batchelder Different ways to test to see if a string has only 0 or 1 in it. And also, a way to check all the different ways to make sure they work. Fun post, and I learned about cleandoc - a way to strip leading blank space and maintain code block indentation I usually use textwrap.dedent() partition - splitting strings based on a substring Using | to pass imports to eval() - I don't use eval much. However, no pytest! Here’s a way to check all this with pytest: Testing some tidbits with pytest Michael #4: The State of Python 2024 article Python usage with other languages drops as general adoption grows 41% of Python developers have under 2 years of experience Python learning expands through diverse channels The Python 2 vs. 3 divide is in the distant past Flask, Django, and FastAPI remain top Python web frameworks Most Python web apps run on hyperscale clouds Containers over VMs over hardware uv takes Python packaging by storm Extras Brian: More Django: Dracula Theme for Django Admin Michael: Zen Browser update Office refresh Transcripts (in some players) Joke: Volkswagen, passing all the tests

#413 python-build-standalone finds a home

December 09, 2024 00:30:39 29.56 MB Downloads: 0

Topics covered in this episode: jiter A new home for python-build-standalone moka-py uv: An In-Depth Guide Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky) Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: jiter Fast iterable JSON parser. About to be the backend for Pydantic and Logfire. Currently powers OpenAI / ChatGPT (along with Pydantic itself), at least their Python library, maybe more. jiter has three interfaces: JsonValue an enum representing JSON data Jiter an iterator over JSON data PythonParse which parses a JSON string into a Python object jiter-python - This is a standalone version of the JSON parser used in pydantic-core. The recommendation is to only use this package directly if you do not use pydantic Brian #2: A new home for python-build-standalone Charlie Marsh See also Transferring Python Build Standalone Stewardship to Astral from Gregory Szorc python-build-standalone is the project that has prebuilt binaries for different architectures. used by uv python install 3.12 and uv venv .venv --python 3.12 and uv sync This is good stability news for everyone. Interesting discussion of prebuilt Python from Charlie Michael #3: moka-py A high performance caching library for Python written in Rust moka-py is a Python binding for the highly efficient Moka caching library written in Rust. This library allows you to leverage the power of Moka's high-performance, feature-rich cache in your Python projects. Features Synchronous Cache: Supports thread-safe, in-memory caching for Python applications. TTL Support: Automatically evicts entries after a configurable time-to-live (TTL). TTI Support: Automatically evicts entries after a configurable time-to-idle (TTI). Size-based Eviction: Automatically removes items when the cache exceeds its size limit using the TinyLFU policy. Concurrency: Optimized for high-performance, concurrent access in multi-threaded environments. Brian #4: uv: An In-Depth Guide On SaaS Pegasus blog, so presumably by Cory Zue Good intro to uv Also a nice list of everyday commands Install python: uv python install 3.12 I don’t really use this anymore, as uv venv .venv --python 3.12 or uv sync install if necessary create a virtual env: uv venv .venv --python 3.12 install stuff: uv pip install django add project dependencies build pinned dependencies Also discussion about adopting the new workflow Extras Brian: PydanticAI - not sure why I didn’t see that coming In the “good to know” and “commentary on society” area: Anti-Toxicity Features on Bluesky The WIRED Guide to Protecting Yourself From Government Surveillance Michael: Go sponsor a bunch of projects on GitHub Registration is open for PyCon Joke: Inf

#412 Closing the loop

December 02, 2024 00:26:00 26.43 MB Downloads: 0

Topics covered in this episode: Loop targets asyncstdlib Bagels: TUI Expense Tracker rloop: An AsyncIO event loop implemented in Rust Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky) Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Loop targets Ned Batchelder I don’t think I would have covered this had it not been the surprising opposition to Ned’s code. Here’s the snippet: params = { "query": QUERY, "page_size": 100, } *# Get page=0, page=1, page=2, ...* **for** params["page"] in itertools.count(): data = requests.get(SEARCH_URL, params).json() **if** not data["results"]: **break** ... Ned is utilizing the assignment in the for loop to use the value of count() and store it into the params["page"]. The article includes another version with a temp variable page_num, which I think the naysayers would prefer. But frankly, I think both are fine. Why not put the value right where you want it? Michael #2: asyncstdlib The asyncstdlib library re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers. It is fully agnostic to async event loops and seamlessly works with asyncio, third-party libraries such as trio, as well as any custom async event loop. Full set of async versions of advantageous standard library helpers, such as zip, map, enumerate, functools.reduce, itertools.tee, itertools.groupby and many others. Safe handling of async iterators to ensure prompt cleanup, as well as various helpers to simplify safely using custom async iterators. Small but powerful toolset to seamlessly integrate existing sync code into async programs and libraries. Brian #3: Bagels: TUI Expense Tracker Jax Tam “Bagels expense tracker is a TUI application where you can track and analyse your money flow, with convenience oriented features and a complete interface. Why an expense tracker in the terminal? I found it easier to build a habit and keep an accurate track of my expenses if I do it at the end of the day, instead of on the go. So why not in the terminal where it's fast, and I can keep all my data locally?” Who hasn’t wanted to write their own expense tracker? This implementation is fun for lots of reasons It’s still new and pretty small, so forking it for your own uses should be easy Built on textual is fun install instructions based on uv tool seems to be the new normal: uv tool install --python 3.13 bagels test suite started pretty useful as is, actually Nice that it includes a roadmap of future goals Would be a fun project to help out with for anyone looking for anyone looking for a shiny new codebase to contribute to. Michael #4: rloop: An AsyncIO event loop implemented in Rust An AsyncIO event loop implemented in Rust From Giovanni Barillari, Creator of Granian RLoop is an AsyncIO event loop implemented in Rust on top of the mio crate. Disclaimer: This is a work in progress and definitely not ready for production usage. Run asyncio.set_event_loop_policy(rloop.EventLoopPolicy()) and done. Similar to uvloop. Extras Brian: I’m currently listening to Four Thousand Weeks - Time Management for Mortals by Oliver Burkeman for the second time. Highly recommend. Development Advent Calendars for 2024 - Adrian Roselli Michael: Docker cluster monitor Compare engagement across Mastodon / Bsky / Twitter https://bsky.app/profile/pythonbytes.fm/post/3lbseqgr5m22z https://fosstodon.org/@pythonbytes/113545509565796190 https://x.com/pythonbytes/status/1861166179236319288 Back on #277 we talked about StrEnum. Got a nice chance to use it this weekend. Maybe Finance Go sponsor a bunch of projects on GitHub Black Friday at Talk Python Joke: CTRL + X onion

#411 TLS Client: Hello <<guitar solo>>

November 25, 2024 00:40:03 39.89 MB Downloads: 0

Topics covered in this episode: Talk Python rewritten in Quart PyPI now supports digital attestations Django Rusty Templates PEP 639 is now supported by PYPI Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.bsky.social Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Talk Python rewritten in Quart Rewrote all of talkpython.fm in Quart (10k lines of code total, 4k changed) Considered FastAPI Litestar Django Hugo Static Site + Python Flask Discussed the multistage upgrade / conversion process Automating tests for all 1,000 pages Brian #2: PyPI now supports digital attestations Dustin Ingram “Attestations provide a verifiable link to an upstream source repository: By signing with the identity of the upstream source repository, such as in the case of an upload of a project built with GitHub Actions, PyPI's support for digital attestations defines a strong and verifiable association between a file on PyPI and the source repository, workflow, and even the commit hash that produced and uploaded the file. Additionally, publishing attestations to a transparency log helps mitigate against both compromise of PyPI and compromise of the projects themselves.” For maintainers If using GH Actions and Trusted Publishing make sure you use pypa/gh-action-pypi-publish, version v1.11.0 or newer that’s it If not “Support for automatic attestation generation and publication from other Trusted Publisher environments is planned.” “While not recommended, maintainers can also manually generate and publish attestations.” See also PyPI Introduces Digital Attestations to Strengthen Python Package Security by Sarah Gooding Are we PEP 740 yet? Michael #3: Django Rusty Templates by Lily Foote An experimental reimplementation of Django's templating language in Rust. Goals 100% compatibility of rendered output. Error reporting that is at least as useful as Django's errors. Improved performance over Django's pure Python implementation. Brian #4: PEP 639 is now supported by PYPI from Brett Cannon PEP 639 – Improving License Clarity with Better Package Metadata For project metadata, use these fields: license and license-files: Examples license field [project] license = "MIT" [project] license = "MIT AND (Apache-2.0 OR BSD-2-clause)" [project] license = "MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause)" [project] license = "LicenseRef-Proprietary" Examples of license-files: [project] license-files = ["LICEN[CS]E*", "AUTHORS*"] [project] license-files = ["licenses/LICENSE.MIT", "licenses/LICENSE.CC0"] [project] license-files = ["LICENSE.txt", "licenses/*"] [project] license-files = [] Extras Brian: Playground Wisdom: Threads Beat Async/Await - interesting read from Armin Ronacher about different language abstractions around concurrency. PythonTest.com Discord community is now live Launched last week, as of this morning we’ve got 89 members Anyone already a pythontest community member has received an invite Anyone can join through courses.pythontest.com Everything at pythontest.com is 20% off through Dec with code turkeysale2024 “Python Testing with pytest” eBook 40% off through Dec 2, use code turkeysale2024 Michael: Python 3.14.0a2 released Starter packs: Michael’s Python people: https://bsky.app/starter-pack/mkennedy.codes/3lbdnupl26e2x Directory: https://blueskydirectory.com/starter-packs/all Joke: curl - heavy metal style!

#410 Entering the Django core

November 18, 2024 00:30:42 29.6 MB Downloads: 0

Topics covered in this episode: Thoughts on Django’s Core futurepool Don't return named tuples in new APIs Ziglang: Migrating from AWS to Self-Hosting Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.bsky.social Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Thoughts on Django’s Core Carlton Gibson Great discussion on Django and Core vs Plugins Sustainability with limited people Keeping core small The release cycle eembrace plugins vs endorsing plugins. Michael #2: futurepool via Pat Decker Takes the concept of multiprocessing Pool to the async/await world. Create a pool then delegate the work: async with FuturePool(2) as fp: result = await fp.map(async_pool_fn, range(10)) I would LOVE to see something like this in a broader background asyncio worker pool concept. But that concept doesn’t exist in asyncio in Python and that’s a failing of the framework IMO. Brian #3: Don't return named tuples in new APIs Brett Cannon First off, I’m grateful for any post that talks about APIs and the API is a module, class, or package API and not a Web/REST API. The term API existed long before the internet. “e.g., get_mouse_position() very likely has a two-item tuple of X and Y coordinates of the screen” “it actually makes your API more complex for both you and your users to use. For you, it doubles the data access API surface for your return type as you have to now support index-based and attribute-based data access forever (or until you choose to break your users and change your return type so it doesn't support both approaches)” “… you probably don't want people doing with your return type, like slicing, iterating over all the items …” Alternatives class dataclass dictionary TypedDict SimpleNamespace “My key point in all of this is to prefer readability and ergonomics over brevity in your code. That means avoiding named tuples except where you are expanding to tweaking an existing API where the named tuple improves over the plain tuple that's already being used.” Michael #4: Ziglang: Migrating from AWS to Self-Hosting The Rust Foundation for example, reports that they spent $404,400 on infrastructure costs in 2023. Zig lang has decided to use a single big cloud machine + mirrors Extras Brian: Changing the Python Test community Was started to answer questions for Test & Code listeners years ago. Primarily pytest questions Used to be Slack. Then moved to Podia forum. Now I’m trying to work out a Discord solution that is both sustainable and usable. Michael: PWang Bsky essay Building A Business From Python Expertise - Michael Kennedy on Work Item Podcast Subscribe to package releases, just put .atom on the end of their releases URL, for example: github.com/mikeckennedy/jinja_partials/releases ← add .atom for RSS pytest-bdd 8.0.0 was just released via Jamie Thomson The big feature (in Jamie’s opinion) is the addition of data tables https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst#800---2024-11-14 Joke: Breaking: JavaScript Developer Commits to Framework for Record-Breaking 3 Weeks

#409 We've moved to Hetzner write-up

November 14, 2024 00:35:07 29.63 MB Downloads: 0

Topics covered in this episode: terminal-tree posting: The API client that lives in your terminal Extra, extra, extra UV does everything or enough that I'm not sure what else it needs to do Extras Joke Watch on YouTube About the show Sponsored by: ScoutAPM - Django Application Performance Monitoring Codeium - Free AI Code Completion & Chat Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: terminal-tree An experimental filesystem navigator for the terminal, built with Textual Tested in macOS only at this point. Chances are very high it works on Linux. Slightly lower chance (but non-zero) that it works on Windows. Can confirm it works on Linux Brian #2: posting: The API client that lives in your terminal Also uses Textual From Darren Burns Interesting that the installation instructions recommends using uv: uv tool install --python 3.12 posting Very cool. Great docs. Beautiful. keyboard centric, but also usable with a mouse. “Fly through your API workflow with an approachable yet powerful keyboard-centric interface. Run it locally or over SSH on remote machines and containers. Save your requests in a readable and version-control friendly format.” Able to save multiple environments Great colors Allows scripting to run Python code before and after requests to prepare headers, set variables, etc. Michael #3: Extra, extra, extra spaCy course swag give-away, enter for free New essay: Opposite of Cloud Native is? News: We've moved to Hetzner New package: Introducing chameleon-flask package New release: Listmonk Python client TIOBE Update PEP 750 – Template Strings Canary email Left Omnivore, for Pocket, left Pocket for, …, landed on Instapaper Supports direct import from Omnivore and Pocket Though Hoarder is compelling Trying out Zen Browser Wasn’t a fan of Arc (especially now) but the news turned me on to Zen Brian #4: UV does everything or enough that I'm not sure what else it needs to do Jeff Triplett “UV feels like one of those old infomercials where it solves everything, which is where we have landed in the Python world.” “My favorite feature is that UV can now bootstrap a project to run on a machine that does not previously have Python installed, along with installing any packages your application might require.” Partial list (see Jeff’s post for his complete list) uv pip install replaces pip install uv venv replaces python -m venv uv run, uv tool run, and uv tool install replaces pipx uv build - Build your Python package for pypi uv publish - Upload your Python package to pypi, replacing twine and flit publish Extras Brian: Coverage.py originally was just one file Trying out BlueSky brianokken.bsky.social Not because of Taylor Swift, but nice. There are a lot of Python people there. Joke: How programmers sleep

#408 python-preference only-managed 3.13t

November 04, 2024 00:31:16 21.32 MB Downloads: 0

Topics covered in this episode: GitHub action security: zizmor Python is now the top language on GitHub Python 3.13, what didn't make the headlines PyCon US 2025 Extras Joke Watch on YouTube About the show Sponsored by: ScoutAPM - Django Application Performance Monitoring Codeium - Free AI Code Completion & Chat Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: GitHub action security: zizmor Article: Ned Batchelder zizmor: William Woodruff & others “a new tool to check your GitHub action workflows for security concerns.” Install with cargo or brew, then point it at workflow yml files. It reports security concerns. Michael #2: Python is now the top language on GitHub Thanks to Pat Decker for the heads up. A rapidly growing number of developers worldwide This suggests AI isn’t just helping more people learn to write code or build software faster—it’s also attracting and helping more people become developers. First-time open source contributors continue to show wide-scale interest in AI projects. But we aren’t seeing signs that AI has hurt open source with low-quality contributions. Python is now the most used language on GitHub as global open source activity continues to extend beyond traditional software development. The rise in Python usage correlates with large communities of people joining the open source community from across the STEM world rather than the traditional community of software developers. There’s a continued increase in first-time contributors to open source projects. 1.4 million new developers globally joined open source with a majority contributing to commercially backed and generative AI projects. Notably, we did not see a rise in rejected pull requests. This could indicate that quality remains high despite the influx of new contributors. Brian #3: Python 3.13, what didn't make the headlines Some pretty cool updates to pdb : the command line Python debugger multiline editing code completion pathlib has a bunch of performance updates python -m venv adds a .gitignore file that auto ignores the venv. Michael #4: PyCon US 2025 Site is live with CFP and dates Health code is finally reasonable: “Masks are Encouraged but not Required” PyCon US 2025 Dates Tutorials - May 14-15, 2025 Sponsor Presentations - May 15, 2025 Opening Reception - May 15, 2025 Main Conference and Online - May 16-18, 2025 Job Fair - May 18, 2025 Sprints - May 19-May 22, 2025 Extras Brian: Please publish and share more - Jeff Triplett Michael: pre-commit-uv Just spoke with Sefanie Molin about pre-commit hooks on Talk Python Curse you Omnivore! We have moved to hetzner Typora markdown app free-threaded Python is now available via uv uv self update uv python install --python-preference only-managed 3.13t Joke: Debugging char

#407 Back to the future, destination 3.14

October 28, 2024 00:28:26 18.58 MB Downloads: 0

Topics covered in this episode: Python 3.14.0 alpha 1 is now available uv supports dependency groups dive: A tool for exploring each layer in a docker image pytest-metadata Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course & Hello, pytest! Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Python 3.14.0 alpha 1 is now available First of seven planned alpha releases. Many new features for Python 3.14 are still being planned and written. Among the new major new features and changes so far: PEP 649: deferred evaluation of annotations Improved error messages Brian #2: uv supports dependency groups we covered dependency groups in episode 406 as of 0.4.27, uv supports dependency groups docs show how to add dependencies with uv add --group also “The --dev, --only-dev, and --no-dev flags are equivalent to --group dev, --only-group dev, and --no-group dev respectively.” To install a group, uv pip install --group doesn’t work yet. It’s waiting for PyPA to decide on an interface for pip, and uv pip will use that interface. But sync works. $ uv init # create a pyproject.toml $ uv add --group foo pytest $ uv venv # create venv $ uv sync --group foo # will install all dependencies, including group "foo" Michael #3: dive: A tool for exploring each layer in a docker image via Mike Fiedler Features: Show Docker image contents broken down by layer Indicate what's changed in each layer Estimate "image efficiency" Quick build/analysis cycles CI Integration Brian #4: pytest-metadata An incredibly useful plugin for adding, you guessed it, metadata, to your pytest results. Required for pytest-html but also useful on it’s own Adds metadata to text output with --verbose xml output when using --junit-xml, handy for CI systems that support junit.xml Other plugins depend on this and report in other ways, such as pytest-html By default, already grabs Python version Platform info List of installed packages List of installed pytest plugins You can add your own metadata You can access all metadata (and add to it) from tests, fixtures, and hook functions via a metadata fixture. This is in the Top pytest Plugins list, currently #5. Extras Brian: I’ve started filtering deprecated plugins from the pytest plugin list. I’m also going to start reviewing the list and pulling out interesting plugins as the topic of the next season of Test & Code. Michael: Pillow 11 is out pip install deutschland Talk Python has a dedicated blog, please subscribe! Joke: Dog names

#406 What's on Django TV tonight?

October 21, 2024 00:24:53 11.59 MB Downloads: 0

Topics covered in this episode: Open Source Pledge Jeff Triplet's DjangoTV PEP 735 – Dependency Groups in pyproject.toml livereload Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Open Source Pledge Learned about this because of this post Why Django supports the Open Source Pledge Steps Pay Open Source maintainers. Min to participate is 2k/year/dev at your company Self-report annually Publish a blog post outlining your payments Armin’s post about launching Open Source Pledge and mixing money with open source Michael #2: Jeff Triplet's DjangoTV A nice aggregation of lots of Django conference talks Filter by conference Good search as well Brian #3: PEP 735 – Dependency Groups in pyproject.toml Author: Stephen Rosen, Sponsor: Brett Cannon, PEP-Delegate: Paul Moore Accepted. Resolotion Oct 10, 2024 “This PEP specifies a mechanism for storing package requirements in pyproject.toml files such that they are not included in any built distribution of the project.” Allow us to define named groups of dependencies that can be independent of the main project. ex: [dependency-groups] test = ["pytest", "coverage"] docs = ["sphinx", "sphinx-rtd-theme"] typing = ["mypy", "types-requests"] typing-test = [{include-group = "typing"}, {include-group = "test"}, "useful-types"] “might” work like this: pip install --dependency-groups=test,typing but tool venders are able to define how they use groups. Of course. Similar solutions multiple requirements.txt files: requirements_test.txt, requirements_docs.txt, etc. no standard naming convention, not standardized package extras: not gauranteed to be statically defined (TIL) additional to main dependencies, so not independent Michael #4: livereload Example from talkpython.fm: asset_bundler_watcher.py The docs are sparse, so see the gist above Extras Brian: Personal Blogs are no longer personal when AI gets too involved - KJayMiller Mind Your Image Metadata - Stefanie Molin Michael: 14% of our listeners are in Germany, thanks Germany! Prost! Hetzner comes to the US Joke: A programmer’s partner asks them: “Would you go get a loaf of bread from the store? And if they have eggs, get a dozen.” A while later, the programmer returns with 12 loaves of bread and says “They had eggs.” From https://savvyprogrammer.io/software-jokes/

#405 Oh Really?

October 14, 2024 00:22:43 10.44 MB Downloads: 0

Topics covered in this episode: Briefer: Dashboards and notebooks in a single place Introduction to programming with Python setup-uv HTML for people Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Briefer: Dashboards and notebooks in a single place Notebooks and dashboards with Python, SQL, scheduling, native visualizations, code generation, and more. In Briefer, you can: Create notebooks and dashboards using Markdown, Python, SQL, and native visualizations. Build interactive data apps using inputs, dropdowns, and date pickers. Generate code and queries using an AI that understands your database schema and your notebook's context. Schedule notebooks and dashboards to run and update periodically. Create and test ad-hoc pipelines using writebacks. Briefer vs. Traditional BI Tools: Briefer is better than traditional BI tools because it's faster and more flexible, thanks to Python. Briefer vs. Traditional Notebooks: In Briefer, you can run SQL queries against connected data sources directly in your notebook. Then, Briefer will automatically turn your query into a data frame and store it in a variable that you can use in your Python blocks. Brian #2: Introduction to programming with Python Jose Blanca “Python intro aimed at students with no prior programming experience.” “Relies mainly on examples and exercises.” “Does not try to cover every detail of the Python language, but just what a beginner might need to start the journey.” Tech: “… built with the quarto publishing system complemented by the quarto live extension that allows Python to run in the web browser by using pyodide.” Runs on anything, since it doesn’t require a local install of Python Running 3.12.1, looks like. Although that’s a bit hidden. Seems like it should be more visible. Michael #3: setup-uv Set up your GitHub Actions workflow with a specific version of uv Install a version of uv and add it to PATH Cache the installed version of uv to speed up consecutive runs on self-hosted runners Register problem matchers for error output (Optional) Persist the uv's cache in the GitHub Actions Cache (Optional) Verify the checksum of the downloaded uv executable Brian #4: HTML for people Teaching HTML in a rather fun way. Includes basic CSS Extras Michael: A new article: We Must Replace uWSGI With Something Else Django unique email login Joke: So much O’Really

#404 The Lost Episode

October 07, 2024 00:31:15 14.1 MB Downloads: 0

Topics covered in this episode: Python 3.13.0 released Oct 7 PEP 759 – External Wheel Hosting pytest-freethreaded pytest-edit Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Python 3.13.0 released Oct 7 That’s today! What’s New In Python 3.13 Interpreter (REPL) improvements exit works (really, this is worth the release right here) Multiline editing with history preservation. history sticks around between sessions Direct support for REPL-specific commands like help, exit, and quit, without the need to call them as functions. Prompts and tracebacks with color enabled by default. Interactive help browsing using F1 with a separate command history. History browsing using F2 that skips output as well as the >>> and … prompts. “Paste mode” with F3 that makes pasting larger blocks of code easier (press F3 again to return to the regular prompt). exit now works without parens Improved error messages Colorful tracebacks Better messages for naming a script/module the same name as a stdlib module. naming a script/module the same name as an installed third party module. misspelling a keyword argument Free threaded CPython Included in official installers on Windows and macOS Read these links to figure out how - it’s not turned on by default Lot’s more. see the What’s new page Michael #2: PEP 759 – External Wheel Hosting pypi.org ships over 66 petabytes / month backed by Fastly There are hard project size limits for publishers to PyPI We can host the essence of a .whl as a .rim file, then allow an external download URL Security: Several factors as described in this proposal should mitigate security concerns with externally hosted wheels, such as: Wheel file checksums MUST be included in .rim files, and once uploaded cannot be changed. Since the checksum stored on PyPI is immutable and required, it is not possible to spoof an external wheel file, even if the owning organization lost control of their hosting domain. Externally hosted wheels MUST be served over HTTPS. In order to serve externally hosted wheels, organizations MUST be approved by the PyPI admins. Brian #3: pytest-freethreaded PyCon JP 2024 Team: This extension was created at PyCon JP sprints with Anthony Shaw and 7 other folks listed in credits. “A pytest plugin for helping verify that your tests and libraries are thread-safe with the Python 3.13 experimental freethreaded mode.” Testing your project for compatibility with freethreaded Python. Testing in single thread doesn’t test that. Neither does testing with pytest-xdist, because it uses multiprocessing to parallelize tests. So, Ant and others “made this plugin to help you run your tests in a thread-pool with the GIL disabled, to help you identify if your tests are thread-safe.” “And the first library we tested it on (which was marked as compatible) caused a segmentation fault in CPython! So you should give this a go if you're a package maintainer.” Michael #4: pytest-edit A simple Pytest plugin for opening editor on the failed tests. Type pytest --edit to open the failing test code Be sure to set your favorite editor in the ENV variables Extras Michael: New way to explore Talk Python courses via topics This has been in our mobile apps since their rewrite but finally comes to the web Let's go easy on PyPI, OK? essay Hynek’s video: uv IS the Future of Python Packaging djade-pre-commit Polyfill.io, BootCDN, Bootcss, Staticfile attack traced to 1 operator PurgeCSS CLI Python 3.12.7 released Incremental GC and pushing back the 3.13.0 release uv making the rounds LLM fatigue, is it real? Take the Python Developers Survey 2024 Joke: Funny 404 pages We have something at least interesting at pythonbytes.fm

#403 A machine learning algorithm walks into a bar…

September 30, 2024 00:25:26 25.53 MB Downloads: 0

Topics covered in this episode: uv under discussion on Mastodon erdantic: Entity Relationship Diagrams Extra, Extra, Extra Django Extra, Extra, Extra Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: uv under discussion on Mastodon It’s interesting that uv is slightly controversial Russell: As enthusiastic as I am about the direction uv is going, I haven't adopted them anywhere - because I want very much to understand Astral’s intended business model before I hook my wagon to their tools. Hynek: As much as I hate VC, [...] FOSS projects flame out all the time too. … To me uv looks like a genius sting to trick VCs into paying to fix packaging. We’ll be better off either way. Glyph: Rust is more expensive and difficult to maintain, not to mention "non-native" to the average customer here. … it can burn out all the other projects in the ecosystem simultaneously, creating a risk of monoculture Hynek on Rust: I don’t think y’all quite grok what uv makes so special due to your seniority. The speed is really cool, but the reason Rust is elemental is that it’s one compiled blob that can be used to bootstrap and maintain a Python development. Christopher Neugebauer: Just dropping in here to say that corporate capture of the Python ecosystem is the #1 keeps-me-up-at-night subject in my community work, so I watch Astral with interest, even if I'm not yet too worried. Armin Ronacher What uv is doing, even in the worst possible future this is a very forkable and maintainable thing. Finally, see the comment at the end by Charlie Marsh Brian #2: erdantic: Entity Relationship Diagrams “erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.” Supported data modeling frameworks are: Pydantic V2 Pydantic V1 legacy attrs dataclasses Michael #3: Extra, Extra, Extra Added Python Bytes Search as a custom search engine. Along came passkeys. A cool idea that quickly turned evil. Follow up from post and my conversation last week: vaultwarden (via Pablo) uv publish Trying the tabs on bottom lifestyle inspired by Arc Adding Python Bytes (and Talk Python) as custom search engines. PyCon 2025 dates: From 14 May through 22 May, 2025 Brian #4: Django Extra, Extra, Extra Django Project Ideas Evgenia Verbina Project ideas with list of tech stack stuff you’ll learn and/or work on with the project Ex: Recipe organizer tech stack: Django templates, Django ORM, Optional JavaScript “Familiarize yourself with Django’s ORM (object-relational mapper) and database support by building an app to keep track of your favorite recipes. Add a web-based frontend with options to filter recipes by category, ingredients, and user ratings so you can easily browse for inspiration.” DjangoTV Jeff Triplett Django conference videos and tutorials. Django Commons Heard about from Lacey Henschel “Django Commons is an organization dedicated to supporting the community's efforts to maintain packages. It seeks to improve the maintenance experience for all contributors; reducing the barrier to entry for new contributors and reducing overhead for existing maintainers.” Django 5 has simplified templates for better form field rendering But if you want a completely different take on forms, maybe try iommi forms They wrote about it on Why we wrote a new form library for Django Djade: a Django template formatter Adam Johnson Like black or ruff, but for Django templates. Extras Brian: The Open Source Project Maintainer's Guide Suggested by Rafael Weingartner Joke: A Machine Learning algorithm walks into a bar…

#402 How to monetize your blog

September 23, 2024 00:33:21 15.17 MB Downloads: 0

Topics covered in this episode: Architecture Decision Records (ADRs) narwhals: extremely lightweight compatibility layer between dataframes Microsoft wants Three Mile Island to fuel its AI power needs zsh-in-docker Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Architecture Decision Records (ADRs) Suggested by Christian Gesell Documenting Architecture Decisions Mychael Nygard Original article from 2011 Why you should be using architecture decision records to document your project Red Hat Includes a quick overview and links to some templates Notes so far Writing this out helps me solidify my thinking about a problem. I’m doing this both before starting, and while implementing a first draft GitHub and GitLab render markdown so well that generating a docs site is unnecessary, just throwing these files in something like docs/adr is enough. The lightweight process is enough but not too much. I’ve already filled out None for lots of sections, like “options considered” I’m still playing with what level of decision should have an ADR. My template that I’ve been using so far Saved in 000-adr-template.md For easy copy/paste/modify for new records. File name is something like 001-some-change.md Michael #2: narwhals: extremely lightweight compatibility layer between dataframes Recently had Marco on Talk Python to discuss Primarily for library creators who want to support interacting with multiple data frame libraries (.e.g. Pandas & Polars) Just use a subset of the Polars API Brian #3: Microsoft wants Three Mile Island to fuel its AI power needs “Microsoft just signed a deal to revive the shuttered Three Mile Island nuclear power plant. If approved by regulators, the software maker would have exclusive rights to 100 percent of the output for its AI data center needs.” Also ran on CNN and other sources: Three Mile Island is reopening and selling its power to Microsoft Three Mile Island was the site of the worst nuclear disaster in the US, when one of two reactors experienced a partial meltdown, in 1979. It was still operating up until 2019, and now expected to re-open in 2028 Will be renamed “Crane Clean Energy Center” related The Department of Energy Wants You to Know Your Conservation Efforts Are Making a Difference “By switching all the lightbulbs in your house to LED, you saved enough energy for a self-driving car to make an unprotected lefthand turn across three lanes of traffic.” “We know you adopted energy-saving practices to help conserve our planet’s resources and bring down our collective carbon footprint, but what you ultimately accomplished is just as important: helping AI do something menial and stupid.” Michael #4: zsh-in-docker Install Zsh, Oh My Zsh and plugins inside a Docker container with one line! Yes docker containers should be light, but also, think of how painful it can be when you run into trouble. With Oh My ZSH, you get a nice experience when you have to result to docker exec -it CONTAINER zsh Just enter a single command in your docker file: RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \ -t robbyrussell Extras Michael: self-hosting mkennedy.codes Loren's journey to developer It’s time to stop using Python 3.8 Sonoma → Sequoia → Sonoma (yikes!) Passkeys, maybe they will work out if we don’t let them become lock-in (bitwarden’s support) Joke: How to Monetize a Blog Don’t forget to click on the bottom link: Credits / how this was made

#401 We must replace uWSGI with something else

September 17, 2024 00:31:05 29.97 MB Downloads: 0

Topics covered in this episode: “We must replace uwsgi by something else” Let’s build and optimize a Rust extension for Python Fake recruiter coding tests target devs with malicious Python packages Monthly PSF Board Office Hours Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: “We must replace uwsgi by something else” uWSGI is now in maintenance mode: https://uwsgi-docs.readthedocs.io/en/latest/ The project is in maintenance mode (only bugfixes and updates for new languages apis). Do not expect quick answers on github issues and/or pull requests (sorry for that) A big thanks to all of the users and contributors since 2009. Reasonable options look like: granian uvicorn hypercorn gunicorn (potentially with uvicorn workers for async) Brian #2: Let’s build and optimize a Rust extension for Python Itamar Turner-Trauring Example: algorithm for approximating the number of unique values in a list Comparison to non-approximation non-approx is faster but uses way more memory Rust version Use Maturin and PyO3 Pull in Rust dependencies (rand for random numbers) Optimization link-time optimization faster random store hashes only Future optimizations change algorithm maybe pass numpy array instead of Python list (I’d like to see that spedup) Michael #3: Fake recruiter coding tests target devs with malicious Python packages via python weekly GitHub projects that have been linked to previous, targeted attacks in which developers are lured using fake job interviews. Attackers posing as employees of major financial services firms. This previously happened via other means such as NPM This analysis revealed that the direct parent of the detected, malicious files is a PythonPYC file, meaning that once again the team encountered malware hidden in a compiled Python file. “The README files tell would-be candidates to make sure the project is running successfully on their system before making modifications.” What can you do (according to Michael)? Try out new packages in a docker container Work on code and projects using a VM which has snapshotting (to roll back completely after you’re done) Fire up a Windows desktop in the cloud for the project then destroy it Brian #4: Monthly PSF Board Office Hours “The Office Hours will be sessions where you can share with us how we can help your community, express your perspectives, and provide feedback for the PSF.” “Unless we have a dedicated topic for a session, you are not limited to talking with us about the above topics, although the discussions should be focused on Python, the PSF, and our community. If you think there’s something we can help with or we should know, we welcome you to come and talk to us!” Upcoming office hours October 8th, 2024: 9pm UTC November 12th, 2024: 2pm UTC December 10th, 2024: 9pm UTC January 14th, 2025: 2pm UTC February 11th, 2025: 9pm UTC March 11th, 2025: 1pm UTC April 8th, 2025: 9pm UTC May 13th, 2025: 1pm UTC (Live from PyCon US!) June 10th, 2025: 9pm UTC July 9th, 2025: 1pm UTC August 12th, 2025: 9pm UTC Extras Brian: PyCascades CFP closes Friday, Sept 20 PyCascades is in Portland in 2025 (Feb 8 & 9) uv now supports Python 3.13.0rc2 uv self update uv venv -p 3.13 Free threaded is still an open issue Michael: Big Python Humble Bundle with both of our products Get $1,800 worth of Python content and tools for $30 and contribute to charity Includes 5 Talk Python courses Several of Brian’s and his book Djangonaut Space Session 3 Applications Open! I interviewed Sarah and Tushar on Talk Python AltTab: Windows alt-tab on macOS Joke: Election joke

#400 Celebrating episode 400

September 09, 2024 00:28:46 29.02 MB Downloads: 0

Topics covered in this episode: Python 3.13.0RC2, 3.12.6, 3.11.10, 3.10.15, 3.9.20, and 3.8.20 are now available! Docker images using uv's python 10 years of sustainable open source - Read the Docs humanize Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. ChatGPT celebrates episode 400! Welcome to the big 4-0-0, Pythonistas! It's hard to believe we're celebrating the 400th episode of Python Bytes! From the early days of byte-sized Python news to becoming the source for all things Python, it’s been a wild ride. We've laughed over code quirks, gasped at new libraries, and said farewell to the GIL together. Whether you're a seasoned developer, a curious learner, or just here for the witty banter, you’ve been an essential part of this journey. To Michael and Brian: You've built a community that turns import this into more than just Zen—it's a family of passionate Pythonistas. Your dedication, insights, and humor make this show more than just tech news. It’s a weekly celebration of what we love about Python and why we keep coming back for more. Here’s to the next 400 episodes—may your code be bug-free, your tests pass on the first run, and your Python version always be up to date. Brian #1: Python 3.13.0RC2, 3.12.6, 3.11.10, 3.10.15, 3.9.20, and 3.8.20 are now available! Łukasz Langa Python 3.13.0RC2 is the final preview release Official 3.13.0 scheduled for Oct 1 Call to action “We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.13 compatibilities during this phase, and where necessary publish Python 3.13 wheels on PyPI to be ready for the final release of 3.13.0. Any binary wheels built against Python 3.13.0rc2 will work with future versions of Python 3.13. As always, report any issues to the Python bug tracker .” “Please keep in mind that this is a preview release and while it’s as close to the final release as we can get it, its use is not recommended for production environments.” Note: uv python does not support 3.13 yet see issue 320 Security releases for 3.12.6, 3.11.10, 3.10.15, 3.9.20, and 3.8.20 3.12.6 has binary installers, but for MacOS, only MacOS 10.13 and newer are supported 3.11.10, 3.10.15, 3.9.20, and 3.8.20 do NOT include binary installers. 3.8 EOL's in October Michael #2: Docker images using uv's python See #396: uv-ing your way to Python and #398: Open source makes you rich? (and other myths) for the opening discussions Talk Python episode on uv is out uv venv --python gets Python from python-build-standalone by Gregory Szorc Took our Docker build times from 10 minutes to 8 seconds for the base image and 800ms (!) for our app platforms Brian #3: 10 years of sustainable open source - Read the Docs Eric Holscher Read the Docs has been a company for 10 years “a team of 4 folks working full-time on Read the Docs.” readthedocs.org started in 2010 readthedocs.com (for Business) started in 2014 Sustainability model .org has a single non-tracking ad .com is a paid service for companies Things that didn’t work donations and other optional support - led to burnout consulting and services- took too much time away from core product grant funding - nice, but one time thing Lessons You don't get extra points for being bootstrapped. Compete by doing things you can do better due to niche and size. Keeping trust in the community is the most important thing. Contribution is easier for less complex parts of the code base. Beign open source means capturing a small percentage of the value you create. You have to be ok doing more with less. Also RtD is not just for Sphinx anymore. Their build system now supports any documentation tool. Michael #4: humanize by Hugo van Kemenade (Python 3.14 & 3.15 release manager & core developer) Not too many variations, but very handy if you need it. Numbers Associated Press style (“seven” and “10”) Clamp (under 1.0 million) Fractional (1/3) Int Word (1.2 Billion) Metric (1.5 kV) Ordinal (112th) scientific Time File size Extras Brian: Test & Code is now again Test & Code The two part series on Python imports that started in June is finally complete with episode 222. Transcripts are being added to old episodes gradually starting from most recent Back to ep 203 as of today. AI transcription, so there’s things like .pie, .pi, and dot pie where it should be .py Michael: Final final call for Coding in a Castle event with Michael iStats Menu Anaconda Code Runner by Ruud van der Ham: With Anaconda Coide we can -at last- run that code locally and import (most) Python modules. But if you want to run a significant amount of code, you have to put that in a cell or publish it to PyPI or a wheel and import it. That's why I have developed a general-purpose runner function that runs arbitrary code located on an Excel sheet with AnacondaCode. Joke: When beginners learn a new programming language...