r/Python • • 13h ago

Showcase Showcase Thread

7 Upvotes

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.


r/Python • • 5h ago

Daily Thread Monday Daily Thread: Project ideas!

6 Upvotes

Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

How it Works:

  1. Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
  2. Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
  3. Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.

Guidelines:

  • Clearly state the difficulty level.
  • Provide a brief description and, if possible, outline the tech stack.
  • Feel free to link to tutorials or resources that might help.

Example Submissions:

Project Idea: Chatbot

Difficulty: Intermediate

Tech Stack: Python, NLP, Flask/FastAPI/Litestar

Description: Create a chatbot that can answer FAQs for a website.

Resources: Building a Chatbot with Python

Project Idea: Weather Dashboard

Difficulty: Beginner

Tech Stack: HTML, CSS, JavaScript, API

Description: Build a dashboard that displays real-time weather information using a weather API.

Resources: Weather API Tutorial

Project Idea: File Organizer

Difficulty: Beginner

Tech Stack: Python, File I/O

Description: Create a script that organizes files in a directory into sub-folders based on file type.

Resources: Automate the Boring Stuff: Organizing Files

Let's help each other grow. Happy coding! 🌟


r/Python • • 12h ago

Discussion Anyone still using Flask, or has FastAPI completely taken over? 🤔

100 Upvotes

​

I've been noticing a lot of developers moving towards FastAPI lately, especially for new Python backend projects.

Flask used to be my go-to for lightweight APIs, but FastAPI seems to be getting all the attention now because of async support, automatic Swagger documentation, and Pydantic validation.

I'm curious about what developers are actually using in production.

- Are you still building new projects with Flask?

- Have you migrated from Flask to FastAPI?

- Is FastAPI genuinely better for production, or is it just the current hype?

Would love to hear some real-world experiences, especially from developers maintaining large-scale applications.

Is Flask still holding its ground, or is FastAPI slowly becoming the default choice for Python backends?


r/Python • • 20h ago

Resource How useful is pre-commit in real-world Python projects, especially in production?

58 Upvotes

I've been exploring Python pre-commit hooks and wanted to understand how commonly they are used in actual production projects.

For those working on production-level Python applications:

- Do you use pre-commit in your daily workflow?

- Which hooks do you usually configure (Ruff, Black, isort, mypy, etc.)?

- Has it genuinely reduced code quality issues or bugs in your team?

- Do you consider it essential for production projects, or is CI/CD linting enough?

Would love to hear how experienced developers use it in real-world teams rather than just tutorials.


r/Python • • 1d ago

Discussion My Python magic is gone

639 Upvotes

I've been coding for a long time, and I've been developing with Python for years.

I loved coding, always loved it. I started many years ago because I wanted to quickly create scripts for security hacking tools, but since then, I've moved to Claude Code, and building cross-language has been a much better experience for me than using Python.

I built my own SaaS application out there whose backend and network core are completely built with Python, and I'm rewriting all of that without writing a single line of code. And most of the time, Python is not the most optimized language.

And now... I feel like the magic is gone.

I don't even know why I'm writing this. I just feel sad about it.


r/Python • • 1d ago

Resource Making np.searchsorted up to 25× Faster in NumPy 2.5

129 Upvotes

I spent some of my free time optimizing "np.searchsorted" and recently wrote a blog post about it.

The new implementation is up to 25× faster in NumPy 2.5. It started with a vectorized NumPy implementation in Python that outperforms NumPy 2.4's native implementation. Then I ported the approach to C++, which was included as part of the NumPy 2.5 release.

The post includes the optimization steps, benchmarks, and comparisons with other array libraries.

https://blog.scientific-python.org/numpy/searchsorted/


r/Python • • 1d ago

Discussion Why has Python dropped so much in the latest TIOBE Index?

35 Upvotes

Hey everyone,

I was taking a look at the TIOBE Index today. I hadn't checked it in a while, and I was surprised to see how much Python has dropped.

It's down by roughly 8 percentage points compared to a year ago, which seems like the first really significant contraction after years of pretty consistent growth.

What's even more interesting is that I don't see another language gaining a similar amount of ground.

I don't use Python myself, so I'm curious: what do you think is behind this decline? Is it actually meaningful, or is it mostly an artifact of how the TIOBE index is calculated?


r/Python • • 1d ago

Daily Thread Sunday Daily Thread: What's everyone working on this week?

13 Upvotes

Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.
  2. Discuss: Get feedback, find collaborators, or just chat about your project.
  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟


r/Python • • 1d ago

Discussion Who is using mobile devices for Python, developement and how?

13 Upvotes

It's a somewhat recurring topic when someone is asking how to run Python or code on mobile, so my question is - who is using mobile for this, and how? learning? coding? What type of device - phones or tablets, Android, Apple?


r/Python • • 10h ago

Resource Zuni: Perplexity for CLI

0 Upvotes

Did you ever think about having Perplexity in the terminal?

That thought turned into Zuni.

Zuni is an open-source AI-powered CLI designed to bring web search and AI answers directly into the terminal, with the goal of making research feel simpler without constantly switching between browser tabs.

I recently rebuilt and published the first usable version of Zuni, including:

• AI-powered question answering from the terminal

• Web-search-oriented workflow

• CLI-first experience

• Python-based architecture

• Documentation with MkDocs Material

• Published package on PyPI

• Open-source development on GitHub

This project started as an experiment, but it has also become a way for me to learn more about APIs, asynchronous Python, CLI design, LLM workflows, packaging, documentation, and open-source development.

There is still a lot to improve. This is only the beginning of Zuni.

GitHub: https://github.com/ssannssarr/Zuni

Docs: https://ssannssarr.github.io/Zuni/

#Python #OpenSource #AI #LLM #CLI #SoftwareDevelopment #GitHub


r/Python • • 1d ago

Discussion Jupyter Notebooks vs Scripts — when do you actually switch from one to the other in a project?

21 Upvotes

How do you decide when to stay with a notebook and when to convert the work into scripts? Is it mainly when the project needs to be automated, reused, scheduled, or shared with others? I’d be interested to hear how people handle this in real projects.


r/Python • • 19h ago

News I wrote a deep dive on the GIL, from cache lines to free-threading (PEP 703)

0 Upvotes

https://harut8.github.io/system-design/python-mastery/24-the-gil/

I put together this guide by researching the GIL, verifying the explanations against CPython's source code, and using AI to help with parts of the writing and explanation.


r/Python • • 2d ago

Discussion Arjan's Software Design Mastery Course Reviews

63 Upvotes

Hi all, I wanted to find out whether anyone has recently taken Arjan’s *Software Design Mastery* course.

I’m a mid-level Python software developer with no formal computer science training. I enjoy Arjan’s YouTube content and am considering paying for the course.

I’m concerned about the impact of agentic AI on my career and am looking for ways to increase my value across the software development life cycle beyond simply generating code. Claude Code is currently writing around 90% of the code I produce. It’s not necessarily something I prefer, but I feel almost forced to use it because of management’s expectations regarding productivity and deliverables. I also don’t want my performance to fall behind that of colleagues who are burning through tokens as if there were no tomorrow.


r/Python • • 2d ago

News Python 3.15 postponed, and a rc3 release

201 Upvotes

https://discuss.python.org/t/python-3-15-following-tradition-lets-have-a-surprise-rc3/109313

Following recent tradition, I'm going to add a surprise third release candidate for Python 3.15.0! We got some last-minute lazy-import release blockers, and it makes sense to include them in 3.15.0 final. It also makes sense to give a bit of time to test them properly, so today's planned 3.15.0 final is postponed, and I'm going to release a 3.15.0rc3 tomorrow, assuming everything is in place. And then 3.15.0 final will follow about week later. Exact date to be announced. - Everyone: once the rc3 is out, please test! - Library maintainers: join the cool testers' club 😎! - Core team: very little will be merged into the 3.15 branch between now and 3.15.0 final. Docs improvements always welcome. Thanks, we're nearly there!


r/Python • • 2d ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

8 Upvotes

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 • • 2d ago

Discussion What's the best way to incorporate LLMs into a python server?

0 Upvotes

Curious to learn how folks are incorporating an LLM into services. subprocess.run seems janky....what's the pythonic way?

Edit: I'd like to be able to interact with my server via a REPL-like loop. Goal: interact with my server remotely, control my zigbee network, etc.


r/Python • • 3d ago

News New Python releases are out, 3.10.x reaches EOL, (and 3.15.0 is scheduled for today)!

76 Upvotes

The new releases announced today, including EOL for 3.10.x: https://blog.python.org/2026/10/python-31022-31117/

Note: The post above doesn't mention 3.15 - assuming they will do a separate post later today when that releases.


r/Python • • 3d ago

Discussion I looked for the most bug-fixed file in 8 well known Python projects

77 Upvotes

I've been reading a lot of git history lately and wanted to run a fun experiment. In a real Python project, which single file collects the most bug fixes.

The method is dumb on purpose. Last 12 months, non-merge commits, bots removed, tests/docs/examples ignored. A commit counts as a fix if the subject has fix, bug, regression, hotfix, broken or revert in it. Then for each file I counted how many of the commits touching it were fixes. The repos came from repowise.dev/explore, which indexes public repos for my open source project , and I just picked the Python ones I recognised.

Most-fixed file per project (fix commits / all commits touching it):

  • langchain: the OpenAI chat model adapter, 58 of 100. Second place is the Anthropic adapter, 42 of 97
  • paperless-ngx: src/documents/views.py, 67 of 142. serialisers.py right behind at 31 of 75
  • fastapi: fastapi/dependencies/utils.py 15 of 46, then fastapi/routing.py 11 of 44
  • prefect: the dbt runner in prefect-dbt, 8 of 12
  • composio: tool_router_session.py, 29 of 59
  • wagtail: wagtail/models/pages.py, 8 of 34

And then hermes-agent, it broke my sense of scale. gateway/run.py had 1,969 commits in a year from 502 different people, and 1,332 of those were fixes. I checked the numbers twice.

Django was in the set and I left it out of the ranking. Django's convention is to write "Fixed #ticket" on nearly every commit, features included. 459 of its 1,044 commits in the last 12 months start with "Fixed #". So by my crude keyword rule Django is the buggiest project on earth, which it obviously is not. (Kind of jealous of that discipline honestly.)

I keep noticing that the top file is usually where the code talks to something non core. langchain's top two are adapters to other companies' APIs. prefect's is the dbt integration. fastapi's are dependency resolution and routing, which is where user code meets the framework. paperless's views.py is the big request handler. Pure logic files basically never showed up near the top.

Also a bunch of these are mostly one person's file. views.py is 63% one person, serialisers.py 73%, fastapi's routing.py 84%.

Although I agree Keyword matching on commit subjects is a bit noisy too, so treat these as a rough picture.

Anyway it was a fun experiment to run


r/Python • • 2d ago

Discussion Interview questions for new hires that I can ask

0 Upvotes

What are some common Python developer interview questions for someone with 3 years of experience?

I've been asked to hire Python developers and since I'm the only one with any kind of programming experience, I was asked. This will be a quick first round interview over zoom for 15-30 mins. For the second-round we will bring in outside consulting for more in-depth evaluation. Thanks in advance.


r/Python • • 3d ago

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

5 Upvotes

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:

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 • • 4d ago

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

14 Upvotes

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 • • 4d ago

Discussion Closing mysql-connector-python pooled sockets

6 Upvotes

Is there some way to close

mysql.connector.pooling.MySQLConnectionPool

sockets properly when the application closes? By default they appear to remain open on the server until way later when they timeout.


r/Python • • 4d ago

Discussion Suggesting ppl to go from unmaintainted library X to yours in github issues?

3 Upvotes

DISCLAIMER: not mentioning any explicit name to avoid framing myself as a useless slop dev advertising his useless slop wrapper that he wrote with sloppy AI because he can in the slop-era.

---

Is this acceptable?

Asking this here because, well the libraries in question are for python for one, but most importantly our ecosystem has various cases of seeing an already established lib slowly replaced by a newcomer, the first I could think of being pandas -> polars.

My situation is that I rewrote a popular library, who is now unfortunately unmaintained, from scratch.
I ported the full test suite as well, published it on Pypi, etc...

By design, my rewrite fixed some pre-existing documented issues, that are yet to be adressed in the original repo, because altought it's creator has done a phenomenal work, it's been years since the last release or even the last answer to an issue.

I thought about answering to the issues that I know with certainty are fixed with my project, inviting to use it/take a look, but I wonder if that's not a bit hostile?

Feel like If we were at an open air market instead of github, I'll just go to my concurrent's stands when he take a break to tell his waiting customers that my products are better lmao.

There's also the fact that even if almost all tests are passing except one very niche situation, ultimately my library is <1.0 and so a stable API is not yet guaranted.

On the other hand, the unmaintained repo is, has I said, respectably popular, and seeing ppl having problems that I know I solved but not telling them feels very dumb.

and ultimately I want my library to be more known to have more potential contributors, as it's scope is much larger than this rewrite and there's a lot more I want to do and any help is always welcome

soo, what do y'all think?

EDIT:

at first referred to my project as n_lib and the old one as o_lib, which ended up just confusing readers. Changed


r/Python • • 5d ago

Resource Generating a tidy HTML report in Python

18 Upvotes

I’m shifting from R to PythonIs there a knit markdown version or similar kind for generating a tidy html report in Python?


r/Python • • 6d ago

Daily Thread Tuesday Daily Thread: Advanced questions

11 Upvotes

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 every Thursday.
  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

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 performance implications of using native Python data structures vs NumPy arrays for large-scale data?
  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! 🌟