Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Reflex Build - V0/Lovable for Python Devs

Hey everyone!

Creator of reflex here. For those who don't know, Reflex is an open source framework to build web apps in pure Python, no Javascript required.

# What my Project Does

Over the past few months, we've been working on Reflex Build – a web-based tool to build apps with Prompting and Python. We wanted to make it easy to create great-looking web apps using AI and then seamlessly hook them up to your existing Python logic. Products like V0/Lovable primarily target JS developers - we want to bring that same experience to the Python ecosystem.

Here's an example app built with just a few prompts, cloning the Claude web interface (and connecting it to the Anthropic Python library): https://claude-clone.reflex.run.

This app specifically used our image-to-app feature - you can view the source code and fork the app here.

Features we've made so far:

Text + image based prompting
Database integration (connect your Postgres database, and we will automatically detect your schema so you can build apps around your data easily)
Github Integration to connect with your local workflow for complex / backend edits
Connected to our hosting service so you can deploy apps straight from the web (you can also download and self-host reflex

/r/Python
https://redd.it/1kl28iq
Best Database and Deployment method to use for a Django + React Project

Hello,

I'm working on a Django + React.ts project, something close to udemy but without video content, only showcasing an academy courses and their details, what database do you recommend me to use? And what should I use for deployment? My website doesn't have authentication, other than the static pages, it has submission forms and courses, instructors and publications to load from database.

Any advice would be much appreciated, this is my first time deploying a website for a client :) thanks in advance.

/r/django
https://redd.it/1kky9z8
Looking for contributors & ideas

# What My Project Does

[`catdir`](https://github.com/emilastanov/catdir) is a Python CLI tool that recursively traverses a directory and outputs the concatenated content of all readable files, with file boundaries clearly annotated. It's like a structured `cat` for entire folders and their subdirectories.

This makes it useful for:

* generating full-text dumps of a project
* reviewing or archiving codebases
* piping as context into GPT for analysis or refactoring
* packaging training data (LLMs, search indexing, etc.)

Example usage:

catdir ./my_project --exclude .env --exclude-noise > dump.txt

# Target Audience

* Developers who need to review, archive, or process entire project trees
* GPT/LLM users looking to prepare structured context for prompts
* Data scientists or ML engineers working with textual datasets
* Open source contributors looking for a minimal CLI utility to build on

While currently suitable for light- to medium-sized projects and internal tooling, the codebase is clean, tested, and open for contributions — ideal for learning or experimenting.

# Comparison

Unlike `cat`, which takes files one by one, or tools like `find | xargs cat`, `catdir`:

* Handles errors gracefully with inline comments
* Supports excluding common dev clutter (`.git`, `__pycache__`, etc.) via `--exclude-noise`
* Adds readable file boundary markers using relative paths
* Offers a CLI interface via `click`
* Is designed to be pip-installable

/r/Python
https://redd.it/1kkzfy8
Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1kl7zw6
synchronous vs asynchronous

Can you recommend a YouTube video that explains synchronous vs asynchronous programming in depth

/r/django
https://redd.it/1kkxyc9
Threads and Multiprocessing: The Complete Guide


Hey, I made a video walking through concurrency, parallelism, threading and multiprocessing in Python.

I show how to improve a simple program from taking 11 seconds to under 2 seconds using threads and also demonstrate how multiprocessing lets tasks truly run in parallel.

I also covered thread-safe data sharing with locks and more, If you’re learning about concurrency, parallelism or want to optimize your code, I think you’ll find it useful.
https://www.youtube.com/watch?v=IQxKjGEVteI

/r/Python
https://redd.it/1kl73hn
Building a Radial GUI Gauge Meter in Python with Tkinter and ttkbootstrap framework

In this tutorial, You will learn to use the meter() class from ttkbootstrap library to create beautiful analog meters for displaying quantities like speed, cpu/ram usage etc.

[YouTube Video of Meter Widget tutorial using Tkinter and ttkbootstrap Library here](https://www.youtube.com/watch?v=zKBg5-Y4NAI).
Original Article along with Source Codes for the ttkbootstrap Meter Widget tutorial here.

You will learn to create a meter, change its appearance like dial thickness, colour, shape of the meter (semi circle or full circle),continuous dial or segmented dial.

How to update the meter dial position using step() method and set() method .

I may use this code base to to build a System monitor in the future using ttkbootstrap widget and psutil library.



/r/Python
https://redd.it/1klexqo
Android style app folders for Windows desktop ( python + pygame )

* **What My Project Does**: this project aims to add app folders similar to the ones seen in android homescreen
* **Target Audience**: For now its just a personal project because i like the look of android folders
* **Comparison** : as far as i have seen , there is no project that atempts to do the same thing but i could be wrong
* **Image** : [Preview Image](https://ibb.co/2rGPGCX)
* **git repo :** [**https://github.com/SrQubit-dev/TapTiles**](https://github.com/SrQubit-dev/TapTiles)
* **More info :**
* this project started in godot but due to some limitation i used pure python with pygame for the gui
* Compatible with ( .exe | .lnk | .url ) apps there are some apps that give issues like PPSSPP but it works with at least 95% of the apps i have incuding steam games
* to add apps just drag and drop the file
* To create a new folder is as easy as creating a shortcut to the main exe and add the argument --CodeName folder\_name at the end , each "CodeName" can have its own apps
* Also the color can be customized using the arguments : --BgColor r,g,b and --BorderColor r,g,b

/r/Python
https://redd.it/1kla0r2
Webserver to control DSLR Camera

Hi, as title says. I am planning to building a webserver that help users control dslr camera (capture, timelapse, change settings, etc.) with Flask, my idea is:

Front-end: HTML, CSS, JS
Back-end: Python, Flask
Library to interact with camera: libgphoto2
Others: Nginx + Cloudflare Tunnel

Workflow will be: User using web interface to control -> js listening user actions and fetch api -> flask app call controller class method (using libgphoto2) -> return result as jsonify -> js display it.

Do you guys think its fine?

English is not my first language sorry for grammar mistakes .


/r/flask
https://redd.it/1klfpd6
Laptop Suggestion

Help me to select a laptop purpose to learn JAVASCRIPT Python.

/r/djangolearning
https://redd.it/1kldymu
D Had an AI Engineer interview recently and the startup wanted to fine-tune sub-80b parameter models for their platform, why?

I'm a Full-Stack engineer working mostly on serving and scaling AI models.
For the past two years I worked with start ups on AI products (AI exec coach), and we usually decided that we would go the fine tuning route only when prompt engineering and tooling would be insufficient to produce the quality that we want.

Yesterday I had an interview for a startup the builds a no-code agent platform, which insisted on fine-tuning the models that they use.

As someone who haven't done fine tuning for the last 3 years, I was wondering about what would be the use case for it and more specifically, why would it economically make sense, considering the costs of collecting and curating data for fine tuning, building the pipelines for continuous learning and the training costs, especially when there are competitors who serve a similar solution through prompt engineering and tooling which are faster to iterate and cheaper.

Did anyone here arrived at a problem where the fine-tuning route was a better solution than better prompt engineering? what was the problem and what made the decision?

/r/MachineLearning
https://redd.it/1klf53p
Querying 10M rows in 11 seconds: Benchmarking ConnectorX, Asyncpg and Psycopg vs QuestDB

A colleague asked me to review our database's updated query documentation. I ended up benchmarking various Python libraries that connect to QuestDB via the PostgreSQL wire protocol.

Spoiler: ConnectorX is fast, but asyncpg also very much holds its own.

Comparisons with dataframes vs iterations aren't exactly apples-to-apples, since dataframes avoid iterating the resultset in Python, but provide a frame of reference since at times one can manipulate the data in tabular format most easily.

I'm posting, should anyone find these benchmarks useful, as I suspect they'd hold across different database vendors too. I'd be curious if anyone has further experience on how to optimise throughput over PG wire.

Full code and results and summary chart: https://github.com/amunra/qdbc


/r/Python
https://redd.it/1klke8k
React + Node | React + Django

I’ve tried React with Node, but React + Django just feels so clean and comfy.

Django gives me user auth, admin panel, and API tools (thanks DRF!) right out of the box. No need to set up everything from scratch.

It’s like React is the fun frontend friend, and Django is the reliable backend buddy who takes care of all the serious stuff.

/r/django
https://redd.it/1klndck
Typesafety vs Performance Trade-Off - Looking for Middle Ground Solution

Hey all,

I'm a fullstack dev absolutely spoiled by the luxuries of Typescript. I'm currently working on a Python BE codebase without an ORM. The code is structured as follows:

- We have a query.py file for every service where our SQL queries are defined. These are Python functions that take some ad-hoc parameters and formats them into equally ad-hoc SQL query strings.
- Every query function returns an untyped dictionaries/lists of the results.
- It's only at the route layer that we marshall the dictionaries into Pydantic models as needed by the response object (we are using FastAPI).

The reason for this (as I was told) was performance since they don't want to have to do multiple transformations of Pydantic models between different layers of the app. Our services are indeed very data intensive. But most query results are trimmed to at most 100 rows at a time anyway because of pagination. I am very skeptical of this excuse - performance is typically the last thing I'd want to hyper-optimize when working with Python.

Do you guys know of any middle-ground solution to this? Perhaps some kind of wrapper class that only validates fields being accessed on the object? In your experience, is the overhead

/r/Python
https://redd.it/1klsydh
D Reviewer cited a newer arXiv paper as prior work and ours was online earlier. How to handle in rebuttal?

I'm currently going through the rebuttal phase of ICCV, and encountered a situation I’d appreciate some advice on.

One of the reviewers compared our submission to a recent arXiv preprint, saying our approach lacks novelty due to similarities. However, our own preprint (same methodology as our ICCV submission, with only writing changes) was publicly available before the other paper appeared. We did not cite our preprint in the submission (as it was non-peer-reviewed and citation was optional), but now that decision seems to be backfiring.

We developed the method independently, and the timeline clearly shows ours was available first. But since we didn’t cite it, the reviewer likely assumed the other work came first.

Given the double-blind review process, what’s the best way to clarify this in a rebuttal without violating anonymity? We don’t want to say too much and break policy, but we also don’t want to be penalized for something we didn’t copy.

Has anyone dealt with this kind of situation before?

/r/MachineLearning
https://redd.it/1klppvn
I built a full-stack Smart Pet Tag Platform with Django, NFC, and QR code scanning

I recently launched SmartTagPlatform.com — a custom-built Django web app that links NFC and QR-enabled pet tags to an online pet profile.

Tech stack: Django, PostgreSQL, Bootstrap, Docker, hosted on a VPS.

Tags are already in the wild. Scans log location/IP and show a contact page to help reunite pets faster.

It’s just me building this so far, but I’m exploring new features like lost pet alerts, GPS integration (AirTag/Tile), and subscription models.

Would love to hear feedback from other devs or anyone building something similar.

/r/django
https://redd.it/1klfrbn
🛠️ Tired of Pytest Fixture Weirdness? You’re Not Alone.

# I just released a small but mighty tool called **pytest-fixturecheck** – and I’d love to hear your thoughts.

Why this exists:
On a fast-moving Django project with lots of fixtures, we kept running into bizarre test failures. Turns out, broken fixtures caused by changes in model attributes were breaking tests in a different part of a project. The tests themselves weren’t the problem – the fixtures were! 😖

Enter fixturecheck**:**

Decorate your fixtures, and stop worrying
Automatically catch when the inputs change in unexpected ways
Spot unused fixtures and over-injection
Add type/value checks to make sure your fixtures behave as you expect
Works in Django, Wagtail, or Python projects

It’s flexible, lightweight, and takes minutes to set up. But it’s already saved us hours of painful debugging.

If you’ve run into similar fixture headaches, I’d love to hear:

How you manage fixture sanity in big projects
Whether this tool helps catch the kinds of bugs you’ve seen
Any ideas for making it smarter!

Repo here: https://github.com/topiaruss/pytest-fixturecheck
Happy testing! 🧪

/r/django
https://redd.it/1km1b6x
Too many installed django apps?

Hi all, I want to breakdown my application into smaller bits. I just have this huge django monolith that takes forever to build in the container.

What are people doing to break down a django app? I was thinking of using a few services outside django and making REST calls to them. Now i'm thinking about the security of that.

I wonder what others do in his scenario.

/r/django
https://redd.it/1klljn8
Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1km1dwe
D Why do people (mostly in media, not in AI/ML research) talk about Meta as if it is behind in the AI industry?

I’ve heard this from a few places, mostly news clips and YouTube channels covering AI developments, but why do people say that Meta is “behind” in the AI industry when compared to Google, OpenAI, Microsoft, Amazon, etc.? I’ve always highly revered Meta, Yann Lecun, and FAIR for open sourcing their contributions, and they do very good research. I read quite a few papers from FAIR researchers. So in what sense do people think they are behind, or is that just ill informed?

/r/MachineLearning
https://redd.it/1klnby4