The author wanted to experiment with improving AI programming quality by continuously asking large models to write better code. After multiple iterations, they managed to improve a simple programming task's performance by 100x! This shows us the importance of prompt engineering and the potential of LLMs in code optimization. I'll definitely try this next time...
TL;DR
Do LLMs actually write better code if you keep asking them to? An honest Django-versus-FastAPI comparison and Google's new white paper on AI agents.
Articles & Tutorials
× 12This article introduces the three main approaches to Python concurrent programming: threads, processes, and asyncio. Using practical code examples and performance tests, it analyzes their pros and cons, showcasing the characteristics and applicable scenarios of each method.
What's going on? In Python, hash(-1) actually equals hash(-2), which is -2? The author dug through Python's official documentation and source code to track down the specific implementation of the hash function and finally found the reason: C language uses -1 to indicate error return values, so the hash() function might return -1 on error. If it correctly returns -1 as well, it would be confusing, so they agreed to use -2 as a replacement...
The author used Cloudflare's Python Workers to turn Microsoft's recently open-sourced MarkItDown into a website. It leverages Pyodide, which uses WebAssembly to port CPython, enabling Python to run in browsers.
A new proposal suggesting adding a default keyword argument to the attrgetter and itemgetter functions in the operator module, so they can return default values when target attributes or items are missing, avoiding exceptions and simplifying code.
pipx is a useful Python package management tool. The article introduces its uses and some limitations, but mainly shares three tips for improving pipx efficiency: managing environments through "injecting" dependencies, using pipx's built-in pip for installations, and installing pipx itself through pipx to get updates.
Compares these two Python frameworks across multiple dimensions, including batteries included, architecture, backend vs full-stack, ease of use/learning curve, modernity, performance, ORM and configuration. As for which to choose, it still depends on project requirements.
The author once participated in developing a Python interpreter called Skybison, which used a moving garbage collector that organizes memory by moving objects and updating pointers. The article explains how to handle weak reference objects during garbage collection and how to implement this in custom garbage collectors.
How do you implement a text-to-video model from scratch? The article provides detailed coverage of relevant theoretical concepts, GAN architecture, model training, implementing specific functions (text embedding layers, generator layers, discriminator layers, etc.), and using the trained model to generate AI videos.
Python can flexibly develop projects and also build long-term infrastructure. The article introduces 15 libraries used in DevOps work, including Django and Flask for developing web dashboards, Schedule and Airflow for task scheduling, Scapy for network analysis, and Docker SDK and Dagger for containerization and cloud interaction, among others.
Anemia affects millions of people worldwide, and traditional detection methods are time-consuming, so the author developed a system that can quickly assess and accurately predict anemia. The project uses scikit-learn to implement a random forest classifier, develops a web interface based on Flask, and the code is open source.
What's the difference between Agents and large models? The hallmark that distinguishes humans from animals is tool use, and Agents are large models that can use tools. Introduces how Agents work, what reasoning frameworks they use, different tool types, improving model performance through targeted learning, and rapidly developing Agents based on LangChain.
Projects & Resources
× 12A concise script that performs intelligent page-by-page analysis of PDF books, systematically extracting knowledge points and generating progressive summaries at specified intervals, with persistent knowledge base storage. Intelligently skips table of contents and index pages.
Uses multiple specialized AI agents working collaboratively to create coherent, structured books based on initial prompts, with automated world-building and setting management, supporting complex, multi-chapter narratives.
A Web UI created based on the recently popular browser-use project, developed with Gradio, supporting multiple LLMs and allowing you to use your own browser without needing to log in again. (2K stars)
An open-source TTS speech synthesis tool from Shanghai Jiao Tong University, using ConvNeXt V2's diffusion Transformer. Supports multilingual switching, speech rate adjustment, and emotional expression. (8.8K stars)
This is a Chrome extension that can track mouse actions like clicks, drags, and hovers in real-time, using OpenAI's GPT model to automatically generate Selenium automation code.
Lets AI help you transform papers into engaging three-person conversational podcast episodes, featuring a host, learner, and expert, providing valuable insights and critical thinking that makes complex information easier to understand and absorb.
An automated operations assistant providing graphical interface and automation scripts, enabling automatic login and article publishing, supporting content generation, image management, and article preview.
Adds AI capabilities to IPython, helping you quickly understand, debug, and write Python code. Context-aware, Markdown responses with syntax highlighting, supports multiple large models, interactive configuration.
A minimalist PyTorch implementation developed using C99 and Python, aimed at understanding the internal mechanisms of PyTorch and other deep learning frameworks. Interestingly, PyTorch team members on X invited this project's author to join PyTorch.
Enables web AI agents to browse the internet as easily as humans, interact with elements, extract structured data, verify identity, upload/download files, and browse without being blocked.
A navigation website that collects trending projects for the Django community, currently featuring over 800 projects.
An open-source e-book suitable for guiding technical document writing, providing reference standards for language style, structural format, content elements, punctuation, formatting and layout. (Shared by @Please Call Me Big Mengmeng)
Podcasts & Videos
× 1I used Google's NotebookLM to turn this newsletter's Season 1 collection into a two-person conversational podcast! Listening to the two hosts earnestly sharing interesting articles and projects from the newsletter feels quite magical. (P.S.: How could we miss Season 2? Python Trending Weekly Season 2 Highlights Collection--English Podcast)