pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

Turtle graphics not working with Mac Sequoia. Running Python 3.12.9

I get this error:

2025-03-21 19:38:02.393 python16933:1310835 +IMKClient subclass: chose IMKClientModern
2025-03-21 19:38:02.394 python[16933:
1310835] +[IMKInputSession subclass]: chose IMKInputSessionModern

Is there an alternative for graphics? I’m just learning to code.

/r/Python
https://redd.it/1jgvbsc

Читать полностью…

Python Daily

Saturday Daily Thread: Resource Request and Sharing! Daily Thread

# Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

## How it Works:

1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.

## Guidelines:

Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.

## Example Shares:

1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.

## Example Requests:

1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

/r/Python
https://redd.it/1jgveqp

Читать полностью…

Python Daily

DRF Deployment

Hi there, I am fairly new to Django and DRF, I have never deployed a django project but have built small development APIs to learn.

I'm trying to deploy a project with gunicorn and nginx (if there is a better alternative, please let me know)

#PROBLEM
I keep running into an issue where my django admin panel hangs frequently, or takes up to 4s to load the page. Check Chrome tools it's usually jsi18n which takes the most time. My apis calls also have a tendency to hang and ends up timing out. I'm using AWD RDS postgres db.

#TRIED
- Upgrading DB
- Checking my SQL queries (at most 500ms)
- Increasing gunicorn workers
- Changed nginx configuration

#INFO
- I have 2 custom models, an altered base user model and a password otp model
- I'm using simple_jwt
- The hanging or long loading can happen on any call or any django admin page (except login page)

If there is any more information, code examples, please let me know.

I'm really struggling to find modern Deployment techniques for DRF, atm my setup is Docker, gunicorn and nginx. If anyone has any up to date resources for better deployment, I would be incredibly grateful.

/r/django
https://redd.it/1jgku8k

Читать полностью…

Python Daily

Soft Launch Quick-Scale – A SaaS Starter Kit

Hey everyone,

I’ve been working on Quick-Scale, a free, open-source (Apache 2.0) Django-based SaaS starter kit designed for AI/ML engineers, Data Scientists, and Backend/Cloud developers who want to launch products faster—without getting stuck in full-stack development.

It comes with built-in authentication, deployment, and a scalable architecture so you can focus on building your product instead of boilerplate setup.

Still in development – Stripe integration and Railway deploy are in progress! Would love any feedback or suggestions from fellow devs.

1️) Install: pip install quickscale
2️) Create project: quickscale build awesome-project
3️) Open: http://localhost:8000

Let me know what you think! Happy to answer any questions.

https://pypi.org/project/quickscale/

Thank you!
Víctor.

/r/django
https://redd.it/1jghzq5

Читать полностью…

Python Daily

Should I Prioritize Learning Programming (Like Python) for AI and Machine Learning After 12th Grade?


I just gave my 12th-grade exams a few weeks ago, and I feel like I might just barely pass. Should I learn a programming language like Python or not? Because I feel like I’m going to waste the next 2-3 months, and once I start doing something, I can only dedicate about 4 hours a day to it. I also want to learn a lot about AI and Machine Learning, as I think I’m interested in this field. For this, I know I need to learn programming languages. So, should I prioritize coding or not? Please someone guide me.

/r/Python
https://redd.it/1jghriu

Читать полностью…

Python Daily

Tutorial on using the Tableview Class from tkifrom tkinter/ttkbootstrap library to create table GUI

A short tutorial on using Tableview Class from tkinter/ttkbootstrap library to create beautiful looking table GUI's in Python.

image of the GUI interface

We learn to How to create the table and populate data into the table.finally we make a simple tkinter app to add /delete records from our table.



[Full Online Article on using Tableview Class to create Tables here](https://www.xanthium.in/create-gui-table-widget-tkinter-using-ttkbootstrap-tableview-class-tutorial)
Source code can be downloaded from GitHub

/r/Python
https://redd.it/1jggpz8

Читать полностью…

Python Daily

Proposal: Native Design by Contract in Python via class invariants — thoughts?

Hey folks,

I've just posted a proposal on discuss.python.org to bring Design by Contract (DbC) into Python by allowing classes to define an __invariant__() method.

The idea: Python would automatically call __invariant__() before and after public method calls—no decorators or metaclasses required. This makes it easier to write self-verifying code, especially in stateful systems.

Languages like Eiffel, D, and Ada support this natively. I believe it could fit Python’s philosophy, especially if it’s opt-in and runs in debug mode.

I attempted a C extension, but hit a brick wall —so I decided to bring the idea directly to the community.

Would love your feedback:
🔗 https://discuss.python.org/t/design-by-contract-in-python-proposal-for-native-class-invariants/85434

— Andrea

/r/Python
https://redd.it/1jgdgob

Читать полностью…

Python Daily

Polars vs Pandas

I have used Pandas a little in the past, and have never used Polars. Essentially, I will have to learn either of them more or less from scratch (since I don't remember anything of Pandas). Assume that I don't care for speed, or do not have very large datasets (at most 1-2gb of data). Which one would you recommend I learn, from the perspective of ease and joy of use, and the commonly done tasks with data?

/r/Python
https://redd.it/1jg402b

Читать полностью…

Python Daily

Django patterns for tables in components

I'm building a dashboard of sorts, which will have multiple tables in blocks - each with its own pagination, filtering and sorting

I really like Iommi (for tables) and django-cotton (for components), and considering unpoly or HTMX - is there a way to make them work together?

I was able to get Iommi working fine, but I can see the query parameters are passed to the url, which breaks things - are there any examples or best practices around this?

/r/django
https://redd.it/1jfucok

Читать полностью…

Python Daily

Janito, an open source code assistance

It uses Claude's optimized tools for file editing and bash commands execution (most likely the same API that powers Claude.AI .

Simple system prompts in order to minimize cost an reduce constrains in the model inference activity.

Ability to adjust the model settings via profiles, and set the role eg. "python developer", "web developer" with role setting.

Janito is in early stages of development, feedback is welcome.

joaompinto/janito: A Language-Driven Software Development Assistant powered by Claude AI

/r/Python
https://redd.it/1jfxnr9

Читать полностью…

Python Daily

Should I stick with Flask or jump ship to NodeJs?

I'm highly proficient in Flask, but I've observed that its community is relatively small compared to other frameworks. What are the reasons behind this? Is it still viable to continue using Flask, or should I consider transitioning to a more popular technology like Node.js?

/r/flask
https://redd.it/1jflpk9

Читать полностью…

Python Daily

Looking for Feedback: HTMX + Django Package

I posted about this package a while ago, but at that point, it was still early in development, and the documentation was lacking. Since then, it has matured a lot, and the documentation has been completely restructured and improved. Additionally, I’ve created a demo site so you can see the package in action with a basic list page featuring CRUD operations (link below).

The core idea of the package (explained in more detail in the docs) is to provide quasi-Django CBV-style views, called hx-requests, which HTMX requests are routed to. This approach separates HTMX-specific logic from your main views by providing dedicated hx-requests to handle them, but at the same time these hx-requests have access to the view’s context, eliminating the need for logic duplication.

There are also other useful features, such as:

* Returning template blocks easily from an hx-request
* Built-in support for Django messages, now with async capabilities
* Integrated modal handling

It’s difficult to summarize everything here, so I’d love for you to check out the demo and documentation and share your feedback!

Demo: [https://hx-requests-demo.com/](https://hx-requests-demo.com/)
Docs: [https://hx-requests.readthedocs.io/en/latest/index.html](https://hx-requests.readthedocs.io/en/latest/index.html)
Github: [https://github.com/yaakovLowenstein/hx-requests](https://github.com/yaakovLowenstein/hx-requests) (feel free to give a star 😊)

TL;DR: A package that provides quasi CBV-style views (hx-requests) as dedicated endpoints for HTMX requests, allowing

/r/django
https://redd.it/1jfcnvu

Читать полностью…

Python Daily

AutoML , what are your thoughts about it wanted to learn more about the same

Recently I found interesting libraries called autoML libraries now that I know that they have for a long time and require heavy gpus.

Are they actually used behind the scenes in companies or is autoML such as autosklearn is dead ?

/r/Python
https://redd.it/1jf1r1a

Читать полностью…

Python Daily

Playa PDF: A strong pdfminer successor

Hi there fellas,

I wanna intro you to a great library - not one of mine, but one which I feel deserves some love and stars.

The library in questions is PLAYA which stands for "Parallel and/or LAzY Analyzer for PDF".

What is this?

This library is similar in scope to pdfminer and its fork pdfminer.six - long-established libraries for manipulating and extracting data from PDF files.

It is partially based on pdfminer.six and includes code from it - but it substantially improves on it in multiple ways.

1. It handles a broader range of PDFs and PDF issues, being very close to the (horrible) specification. For example, the author of the library (dhaines) has recently added an enormous test suite from PDF.js (one of the more ancient libraries in this space), which includes a whole gamut of weird PDFs it can handle.
2. It's much faster - well, as far as Python goes, but it is faster than the other Python libs by a factor of at least two, if not three, and not only when parallelizing.
3. complete metadata extraction - this part is what got me into this since I am integrating this with Kreuzberg now (a library of mine, which you

/r/Python
https://redd.it/1jfk466

Читать полностью…

Python Daily

Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

# Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.

---

## How it Works:

1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

---

## Guidelines:

- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.

---

## Example Topics:

1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?

---

Let's help each other grow in our careers and education. Happy discussing! 🌟

/r/Python
https://redd.it/1jfbrhk

Читать полностью…

Python Daily

Announcing Dash Particles: Interactive tsParticles Animations for Dash

Announce the release of Dash Particles, a new component library that brings beautiful, interactive particle animations to your Dash applications!

# What My Project Does?

Dash Particles is a wrapper around the powerful tsParticles JavaScript library, making it seamlessly available in Dash (only published for python, but probably easy to publish in R, julia). It allows you to create stunning interactive visual effects shown on the Github

# Installation

pip install dash-particles

# Example Usage

import dash
from dash import html
import dashparticles

app = dash.Dash(name)

app.layout = html.Div([
html.H1("My App with Particles"),

dash
particles.DashParticles(
id="particles",
options={
"background": {
"color": {"value":

/r/Python
https://redd.it/1jgzenr

Читать полностью…

Python Daily

Something's wrong!

I'm trying to learn django with w3schools tutorials. I learned python there and it was fine. I learned numpy and pandas and they were easy and readable and comprehensible. But now in the django tutorial I find myself completely lost!

Look I don't even know where the problem is. is it me? is it the tutorial? the django itself?

Cause I haven't worked web before at all. I didn't even knew how to find directory in cmd but I'm researcher at heart. I dig deep and figure it out. But I find myself, with django, in a state of despair. I'm up till models tutorial and still copy-pasting stuff and I don't know why. There are lots of lines to copy which none I'm familiar with and since I don't understand them, repeating them and writing them doesn't help either. Tutorial doesn't explain these to me and I honestly for the first time feel overwhelmed.

Should I have a background in web dev then I learn django? Am I missing something?

/r/django
https://redd.it/1jgac79

Читать полностью…

Python Daily

Using Polars as a Vector Store - Can a Dataframe library compete?

Hi! I wanted to share a project I've been working on that explores whether Polars \- the lightning-fast DataFrame library - can function as a vector store for similarity search and metadata filtering.

What My Project Does

The project was inspired by this blog post. The idea is simple: store vector embeddings in a Parquet file, load them with Polars and perform similarity search operations directly on the DataFrame.

I implemented 3 different approaches:

1. NumPy-based approach: Extract embeddings as NumPy arrays and compute similarity with NumPy functions.
2. Polars TopK: Compute similarity directly in Polars using the top_k function.
3. Polars ArgPartition: Similar to the previous one, but sorting elements leveraging the arg\_partition plugin (which I implemented for the occasion).

I benchmarked these methods against ChromaDB (a real vector database) to see how they compare.

Target Audience

This project is a proof of concept to explore the feasibility of using Polars as a vector database. At its current stage, it has limited real-world use cases beyond simple examples or educational purposes. However, I believe anyone interested in the topic can gain valuable insights from it.

Comparison

You can find a more detailed analysis on the README.md of the project, but here’s the summary:

\- ✅ Yes, Polars can be used as

/r/Python
https://redd.it/1jgtjnr

Читать полностью…

Python Daily

Column data getting mixed up in SQLAlchemy database for rows at random

So here is the deal. I have a list of dictionaries which I am looping through, adding each of the keys to a database in each iteration of a loop. After the entire list has been added and committed to the database, I look at the database, and randomly (or it seems random at least), there are rows that are duplicated but when several of the column data shifted to the wrong column. Most of the time, it seems like a duplicate row where this happens (one row is fine, the other is screwy), but I have seen at least one row where there isn't a duplicate but its columns are mixed up.

If all rows are like this, then I would gather that the issue is somewhere in my code, the way that I am adding data to the columns of my database in the flask app logic, but since most rows are okay (maybe 80%), I'm not too sure what is going on is in the logic but rather somewhere else.

See the attached picture for an example of the database record which is faulty (row 17, which seems to be a faulty copy of row 18) and below for

/r/flask
https://redd.it/1jg8rmo

Читать полностью…

Python Daily

Need advice building an app

I help my best friend post his beats on youtube. He’s a producer. Basically its adding a high quality picture from pininterest and just joining it together with the mp3 of the song/beats in premiere pro. I feel like I should be able to create an app which can automate all these processes.

-That would find an high quality image on the internet
-And all I simply have to do is to give it the mp3 and it does the rest and even upload to the channel. It would be nice if it could go through the channel and check which the thumbnails used in the videos to get a feel of what kind if image to use.

I find this interesting for myself but I have zero to no programming or coding knowledge. Hence, the question is, if I wanted to do this, what would you suggest I learn and what other tips can anyone else give to make it work? Thank you:)

/r/Python
https://redd.it/1jgm232

Читать полностью…

Python Daily

How I Helped a Beginner Learn Power BI, Excel & Python for Data Analysis


A few months ago, I started helping people learn data analysis, even if they had zero experience. One of my students, who had never used Power BI or Python before, went from complete beginner to confidently analyzing real-world datasets in just three weeks.

I’ve noticed that many beginners struggle with:
✅ Choosing the right tool (Excel? Power BI? Python?)
✅ Cleaning and visualizing data effectively
✅ Building projects that actually get attention

So, I put together simple, beginner-friendly tutorials that help people master Power BI, Advanced Excel, Tableau, and Python without feeling overwhelmed.

If you’re curious about data analysis and want to learn in a practical, no-jargon way, I’m happy to share some free beginner tips to get you started.

Drop a comment or DM me if you're interested!

/r/IPython
https://redd.it/1jgc6xe

Читать полностью…

Python Daily

A low-pass filter with an LFO

# Background

I am posting a series of Python scripts that demonstrate using Supriya, a Python API for SuperCollider, in a dedicated subreddit. Supriya makes it possible to create synthesizers, sequencers, drum machines, and music, of course, using Python.

All demos are posted here: r/supriya\_python.

The code for all demos can be found in this GitHub repo.

These demos assume knowledge of the Python programming language. They do not teach how to program in Python. Therefore, an intermediate level of experience with Python is required.

# The demo

In the latest demo, I show how to create a resonant low-pass filter and modulate the filter's cutoff frequency with a low frequency oscillator.

/r/Python
https://redd.it/1jgcclm

Читать полностью…

Python Daily

Deploy django project

Hello everyone, I want to ask if anyone know any service for hosting my django project for free. And for also for hosting the database, I try use vercel but isn't work 😕 is give only 250mb to test and the project bigger than that.

/r/django
https://redd.it/1jfqevk

Читать полностью…

Python Daily

Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1jg3nlu

Читать полностью…

Python Daily

pnorm: A Simple, Explicit Way to Interact with Postgres

GitHub: https://github.com/alrudolph/pnorm

# What My Project Does

I built a small library for working with Postgres in Python.

I don’t really like using ORMs and prefer writing raw SQL, but I find Psycopg a bit clunky by itself, especially when dealing with query results. So, this wraps Psycopg to make things a little nicer by marshalling data into Pydantic models.

I’m also adding optional OpenTelemetry support to automatically track queries, with a bit of extra metadata if you want it. example

I've been using this library personally for over a year and wanted to share it in case others find it useful. I know there are a lot of similar libraries out there, but most either lean towards being ORMs or don’t provide much typing support, and I think my solution fills in the gap.

# Target Audience

Anyone making Postgres queries in Python. This library is designed to make Psycopg easier to use while staying out of your way for anything else, making it applicable to a wide range of workloads.

I personally use it in my FastAPI projects here’s an example (same as above).

Right now, the library only supports Postgres.

# Comparison

Orms

SQLAlchemy is a very popular Python ORM library. SQLModel builds on SQLAlchemy with a Pydantic-based interface.

/r/Python
https://redd.it/1jfuqab

Читать полностью…

Python Daily

How to Use Async Agnostic Decorators in Python

At Patreon, we use generators to apply decorators to both synchronous and asynchronous functions in Python. Here's how you can do the same:

https://www.patreon.com/posts/how-to-use-async-124658443

What do you think of this approach?

/r/Python
https://redd.it/1jfpt7q

Читать полностью…

Python Daily

Problem with template form

Hello all, working on a learning project where I am trying to create an add user form. The form contains a select element that pulls its options from a database table that holds all of the "tracks" that are available. The intent is that the Track.trackName will be passed with the POST request. However, all that gets passed is the first word of Track.trackName....How am I being dumb? This is the relevant code:

\--Part of template--

<form action="./addLearner" method="POST" id="addLearner">
{% csrf_token %}
<label for="fname">First Name: </label><input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last Name: </label><input type="text" id="lname" name="lname"><br><br>
<label for="empID">Employee ID#: </label><input type="text" id="empID" name="empID"><br><br>


</form>

<label for="tracks">Learning Track: </label>
<select name="tracks" id="tracks" form="addLearner">


/r/djangolearning
https://redd.it/1jfcl4y

Читать полностью…

Python Daily

Interactive Python Learning Series: From Numbers to Exceptions

Hey Python folks,

I wanted to share a project I've been working on, creating interactive Python tutorials — series of Python fundamentals notebooks in our marimo-learn repository.

What This Project Does: We've built tutorials covering the Python journey from basics to more complex topics. The notebooks are reactive — change code in one place and see updates ripple through in real-time, which makes learning way more intuitive. The content covers Python fundamentals (data types, strings, collections) and builds up to functions, modules, and exception handling. What makes these different is that they're fully interactive and run natively in your browser (thanks to WASM & Pyodide).

Target Audience: Python learners and teachers who prefer hands-on experimentation over passive reading; devs who want to explore Python concepts through an interactive medium rather than static documentation.

Comparison to Alternatives: Unlike static tutorials or videos, these notebooks combine explanation, code, and output in a reactive environment. When you modify code in one cell, all dependent cells automatically update, showing how concepts interconnect.

Source Code: All notebooks are available at /python folder, organized in an appropriate progression (in terms of topics).

We're also looking for Python enthusiasts to contribute additional specialized tutorials. If you're interested, check out our GitHub repository for

/r/Python
https://redd.it/1jfjmf3

Читать полностью…

Python Daily

A Feature-rich Flask Web Application Template

What My Project Does

I made a Flask starter template to save time setting up new projects. It includes:

\- A blueprint-based structure for better organization

\- GitHub Actions for testing & lining

\- Makefile and Poetry for managing the development workflow (testing, linting, database migrations, containerization, etc.)

\- Comes with lots of useful Flask extensions already installed and ready to use (SQLAlchemy, Login, WTF, Admin, Caching, etc.)

GitHub: https://github.com/habedi/template-web-app-flask

Let me know what you think!

/r/Python
https://redd.it/1jf9ovo

Читать полностью…

Python Daily

A Feature-rich Flask Web Application Template 🐍

Hi,

I made a Flask starter template to save time setting up new projects. It includes:

✅ A blueprint-based structure for better organization

✅ GitHub Actions for testing & linting

✅ Makefile and Poetry for managing the development workflow (testing, linting, database migrations, containerization, etc.)

✅ Comes with lots of useful Flask extensions already installed and ready to use (SQLAlchemy, Login, WTF, Admin, Caching, etc.)

🔗 GitHub: https://github.com/habedi/template-web-app-flask

Let me know what you think! 🚀

/r/flask
https://redd.it/1jf98hk

Читать полностью…
Subscribe to a channel