Python Programming Leftovers
-
Juha-Matti Santala ☛ Blaugust 2024: Batteries included
I’m a huge fan of Python’s standard library and this month I want to share with you blog posts about exactly that. I’ll reserve a few days for other posts: today’s introduction, last day’s recap, one day for IndieWeb Carnival and a few days for other posts if something time-sensitive emerges during the month. So there will be somewhere between 25 and 28 posts about standard library this month.
-
OSTechNix ☛ Build Fast, Scalable Web Apps With Python Using FastHTML
In this tutorial, we will learn what FastHTML is, how it works and how to build web apps faster in Python using FastHTML in Linux.
-
OSTechNix ☛ How To Fix ‘No Module Named Pip’ Error In Python In Linux
This brief tutorial explains how to fix the "ModuleNotFoundError: No module named pip" error in Python in Debian Linux.
-
LWN ☛ A new major version of NumPy
The NumPy project released version 2.0.0 on June 16, the first major release of the widely used Python-based numeric-computing library since 2006. The release has been planned for some time, as an opportunity to clean up NumPy's API. As with most NumPy updates, there are performance improvements to several individual functions. There are only a few new features, but several backward-incompatible changes, including a change to NumPy's numeric-promotion rules. Changes to the Python API require relatively minor changes to Python code using the library, but the changes to the C API may be more difficult to adapt to. In both cases, the official migration guide describes what needs to be adapted to the new version.
The 2.0.0 release was in development for 11 months, much longer than the typical NumPy release. In that time, 212 contributors sent 1078 pull requests — nearly a tenth of all pull requests made to date against the project's GitHub repository. The NumPy 2.0.0 transition manages to address many small problems across the API, while not creating too much work for users of the library.
-
LWN ☛ Imitation, not artificial, intelligence
Simon Willison, co-creator of the popular Django web framework for Python, gave a keynote presentation at PyCon 2024 on a topic that is unrelated to that work: large language models (LLMs). The topic grew out of some other work that he is doing on Datasette, which is a Python-based ""tool for exploring and publishing data"". The talk was a look beyond the hype to try to discover what useful things you can actually do today using these models. Unsurprisingly, there were some cautionary notes from Willison, as well.
-
LWN ☛ Restricting execution of scripts — the third approach
The kernel will not consent to execute just any file that happens to be sitting in a filesystem; there are formalities, such as the checking of execute permission and consulting security policies, to get through first. On some systems, security policies have been established to limit execution to specifically approved programs. But there are files that are not executed directly by the kernel; these include scripts fed to language interpreters like Python, Perl, or a shell. An attacker who is able to get an interpreter to execute a file may be able to bypass a system's security policies. Mickaël Salaün has been working on closing this hole for years; the latest attempt takes the form of a new flag to the execveat() system call.