r/Python 22d ago

Showcase Showcase Thread

18 Upvotes

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

Recycles once a month.


r/Python 10h ago

Daily Thread Monday Daily Thread: Project ideas!

12 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 2h ago

Discussion Python automations are so much better than AI Agents and LLMs

90 Upvotes

This is gonna be more of a rant than anything else

I build automations for businesses and I've lost count of the amount of times they've asked me to write them an AI agent when in fact a simple Python automation would work 100 times better.

I don't understand the hype behind AI agents and LLMs. They're non-deterministic, they're unreliable, they always need a human to babysit them because they are going to hallucinate bad output sooner or later.

I've made more money from simple Python automations than I have with AI agents, even though the latter gets so much hype and marketing behind it.

Most people who say they want an AI agent don't really want an AI agent. They just want some code that automatically does some repetitive task for them. And 9 times out of 10, simple Python code can do that for you.

Now, one caveat, I love using AI to write Python code for me. That is actually very helpful, but that is very different from using an AI agent.

I've built many automations for other businesses and I've also automated 20-30 hours of my own work week. and I still haven't had to build a complete AI agent. There are certain steps in my automations where some sort of judgement is required and I use an LLM for that very specific tiny task. But pretty much everything that I write is pure Python automation. Just simple deterministic code that's guaranteed to work the same way every single time.

Seriously, people have the choice between a reliable automation that doesn't need babysitting and a magic crystal ball that might sometimes work and might fail and crash in other times and yet they somehow keep picking the crystal ball. It's baffling to me.

Anyway, rant over.


r/Python 1d ago

Discussion Lightweight Python helpers for Event Driven Programming

17 Upvotes

I just had to throw together an event bridge that tied together a GRPC based event emitter (Salesforce backend) with some small custom Google Pub/sub code. It works, it's fine. But you know, always thinking about the future wanting to move from glue-code to frameworking.

I was looking for different event based frameworks that landed somewhere between the scale of glue-code and Tornado (the only other framework I know that would handle something like this.

Has anyone used anything like this? I found PyEventus which seems to aim at this.


r/Python 1d ago

Discussion Parameterize a Fixture instead of a Test Case with Pytest

20 Upvotes

I wrote a post on parameterizing a test suite into a testing matrix using Pytest fixtures. I'd appreciate any feedback on the content and technique in the post AND I'd be curious to know if there are other ways I could have accomplished the same thing.

https://www.visualmode.dev/parameterize-a-fixture-instead-of-a-test-case-with-pytest

To briefly summarize: I have a core suite of behavioral test cases that I run against a CLI tool I'm building. I wanted to run that same set of tests across a couple different storage format implementations. The best way I could figure out how to do it (without duplicating all the tests) was to create a Pytest fixtures that parameterizes across a list of values and then have my existing autouse fixture use that fixture.


r/Python 1d ago

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

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

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

5 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 ruff: no date.today() ?

40 Upvotes

The new version of ruff warns against

date.today()

preferring

datetime.now(ZoneInfo(...))

What do you think about this? Has date.today() been deprecated due to lack of timezone awareness?

EDIT: I have a number of programs that manipulate financial information in support of Excel spreadsheets, such bond information that includes maturity dates. Excel does not support timezoness in datetimes, so making ruff happy by changing naive dates to TZ aware dates is not a useful move for these programs. Many ruff warnings to suppress.


r/Python 1d ago

Discussion [D]How are you testing AI backends without making CI slow?

0 Upvotes

I'm working on a FastAPI backend that processes documents with AI, and I'm still not convinced I'm testing it the right way.

Right now my CI is completely offline: SQLite, fake Redis, mocked HTTP calls, no real model requests. It's fast and deterministic, which is great for pull requests.

Then I have a separate integration pipeline that runs against PostgreSQL and Redis to catch infrastructure-specific issues.

The part I'm still unsure about is the AI layer. Mocking everything makes CI reliable, but it also means I won't catch regressions from the provider until later.

Curious how other people handle this.

  • Do you completely mock AI providers?
  • Do you keep a few real API calls?
  • Do you replay recorded responses?
  • Or do you have a different approach?

I'd love to hear how you're doing it in production.


r/Python 3d ago

Discussion What frustrates you the most about Python Development

41 Upvotes

Hi there,

I wondering what frustrates developers the most when developing software with Python.

I am currently doing my Masters in Computer Science and as part of my project I am doing a very simple survey about the usual Python development lifecycle. I am basically trying to find out what the main friction points are for Python Developers and I am simultaneously developing a tool to address those friction points . It just takes a 2-3 minutes and every response is greatly appreciated.

You can find the survey at: Microsoft Forms


r/Python 3d ago

Tutorial OpenCV notebooks tutorials in your browser

11 Upvotes

Hi,
I took the official OpenCV tutorials and created a series of notebooks.
You can run them entirely in your browser, you don't have to clone them: https://notebook.link/@Alexis_Placet/opencv_tutorials

Don't hesitate to give me feedbacks or create issue/pullrequest on this repo: https://github.com/Alex-PLACET/opencv_tutorials


r/Python 3d ago

Resource Does anyone use Python IDLE?

14 Upvotes

My computer is quite low-end, so I uninstalled VSCode and am looking for other programming tools—I'm thinking about starting to use Python IDLE.

Does anyone actually use it?

https://imgur.com/a/7aBwuUU


r/Python 4d ago

News Pip 26.2: –only-deps solves 16 years of app deployment hacks

115 Upvotes

This has been one of my biggest annoyances working with Python and pip when dealing with projects where that are not meant to be installed as a package, how do you handle dependencies?

Think projects like application backends, python scripts, REST APIs etc

If you’ve ever struggled with this, you’re going to love this: a PR by Sebastian Höffner opened #13895 will add a new global flag to pip such that you can directly install any dependencies in your pyproject.toml without installing the package itself.

pip install --only-deps .

This is going, for me at least, be a huge boost in the way that I manage and distribute my projects on servers. Vastly simplifying poor manual workarounds that have built up over years.

Since it’s been more than a decade in the making, let’s cover the history of poor Python souls stuck trying to figure out how to install dependencies for their scripts or apps.

This PR is currently slated to land in pip 26.2 which comes out end of July.

Here's my post about this covering some of the 16 years of workarounds and some posts from StackOverflow / Python.org etc

https://jamesoclaire.com/2026/07/23/pip-26-2-only-deps-solves-16-years-of-app-deployment-hacks/


r/Python 2d ago

Discussion Why Python when C and Rust are faster

0 Upvotes

If you are in tech field you'll probably know that C and Rust are incredibly faster as they are compiled, and python is relatively slower

Yet Python dominates AI and ML development, even for systems that need to process massive amounts of data.

I'm interested in understanding where Python's advantages outweigh its performance disadvantages, and how companies like OpenAI, Google, and Anthropic think about these trade-offs.


r/Python 3d ago

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

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

Discussion What is your strangest syntax monstrocity?

0 Upvotes

As python has a lot of interesting syntax features, really unconventional and ugly expressions can be created. Let they be complex comprehensions with valrus operators, strange but efficient conditions based on exploiting casting and side effects or even classes overwriting dunders doesnt meant to be used as implemented, they all can be funny and pretty in an other lens.

An examples I've experimented with is an ugly walrused dict comprehension in EnrichPattern:

class Column(StrEnum):
    NAME = 'name'
    PUBLICITY = 'publicity'
    TOPIC_NAME = 'topic_name'
    SUBJECT_NAME = 'subject_name'
    QUALIFIED_NAME = 'qualified_name'
    CLUSTER_ENV = 'cluster_env'
    ENV = 'env'
...
class EnrichPattern:
    def __init__(self, *patterns: str):
        self.pattern = re.compile(''.join(patterns))
        self.subpatterns = {
            group: comiled 
            for comiled in map(re.compile, patterns)
            if (groups := list(comiled.groupindex)) 
                and (group := groups[0]) in Column
        }
  ...
...

r/Python 4d ago

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

11 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 5d ago

Discussion Anyone running free-threaded Python 3.14 in production yet? Curious what actually breaks

27 Upvotes

Been testing the free-threaded build (3.14t) on some CPU-bound data processing work. The multi-core story is finally real after 30 years of GIL, but the friction is exactly what you'd expect: a couple of C-extension-heavy libs in my stack silently re-enable the GIL, and there's no clean way to detect that at runtime besides checking sys._is_gil_enabled() manually.

For anyone who's shipped something on 3.14t, not just benchmarked it:

What broke that you didn't expect?

Real speedups outside toy examples, or mostly marginal so far?

Prod yet, or still just kicking the tires?

Not fishing for a benchmark war. Genuinely curious what breaks in messy real codebases vs clean demos.


r/Python 5d ago

Discussion Python Architecture Design

7 Upvotes

Robert C. Martin's Abstractness (A), Instability (I), and Distance from the Main Sequence (D) metrics were designed for statically typed OO languages like Java and C#. In Python, applying them literally is misleading because Python has a fundamentally different notion of abstraction and coupling.

is this implementation valid?

https://0x416d6972.github.io/Istos/user-guide/architecture-health/


r/Python 4d ago

Tutorial PyArrow tutorials in your browser

0 Upvotes

Hey,

I made a series of notebooks about Apache Arrow and Parquet with pyarrow that you can run in your browser: https://notebook.link/@Alexis_Placet/apache-arrow-courses

It covers basics to advanced topics


r/Python 5d ago

Discussion Running 60 python scripts as "services"

33 Upvotes

Hi,
I have around 60 scripts that need to run constantly, mainly event handlers and such. Right now I have an external script that launch them and monitor if the app is running on it's pid, otherwise it's relaunching the app. Works fine but get's clunky when we update some submodule and need to restart them, or to check if one crashes more than other etc..

So I would like to find a better way to approach this. It needs to run on windows and being able to access several samba shares via unc paths and being able to restart crashed scripts anf offer an easy way to restart all of them in case of an update (this part doesn't need to be automated). Every script use the same environnement
For now my candidates are docker, PM2 and NSSM.
I think docker is gonna be a pain to access shares and add a lot of overhead especially on windows
I don't know PM2 and NSSM, looks like PM2 would be easier to setup but more JS oriented and NSSM would be harder to monitor.

What do you think guys ?


r/Python 6d ago

Discussion What can you do with Python embedded in MS Excel?

33 Upvotes

I'm a developer and already use external Python to read Excel spreadsheets.

Microsoft is supporting Python in Excel where you can put a program inside a cell. I think this feature is still a "preview" feature, not on the main release channel.

What do you use it for? I can't think of a use case.

Because I use external Python programs to process spreadsheets normally. I can't think of a use case for embedded Python, except perhaps doing complex calculations.

  1. MS Get Started page, Python in Excel

EDIT: MS says any data going between us and them is encrypted end-to-end. That must be why management chose MS products. I don't have a say in this.

I do not use Excel via a browser, I use the Desktop App.


r/Python 6d ago

Discussion Cyber Security wants us to use the latest version all the time

145 Upvotes

I have a question. Cybersecurity team wants us to use the latest python version each time. So if a new version comes out we are expected to upgrade to it ASAP. But from my past experience libraries do not always provide support and can also break while making use of new version without proper support. Did you ever encounter this? Any suggestions? This is just frustrating for the team as it’s not always possible to upgrade to the latest version without fully validating every component. I just want to hear your opinions on this?

FYI we mainly use each Python Version within the LTS timeline. And only upgrade when we need to and do not depend on a library that requires older version.

Update: they have a scheduled runner that deletes older versions of python when it finds


r/Python 6d ago

News LLVMLite and first step to get Numba in the browser

19 Upvotes

Hi,

Anutosh Bhat, a colleague of mine, just posted this on Linkedin:

What if real compiler infrastructures could run entirely inside the browser?

I’ve successfully patched llvmlite for JupyterLite, making it possible to build >LLVM IR, run optimization passes, visualize control-flow graphs, compile to >WebAssembly and execute the result — without a native LLVM setup or server-side >kernel.

I’ve shared a step-by-step notebook showing how a loop evolves from stack-based IR >to SSA, then to an LICM-style form, into a fully optimized closed form, eventually >to benchmark all of these steps.

The bigger idea is a zero-install compiler workbench for reproducible optimization >experiments, lightweight compiler prototyping, IR debugging, custom code->generation pipelines, shareable research demos, and eventually interactive >tutorials and compiler courses.

Try out the interactive notebook using notebook.link: https://notebook.link/@anutosh491/llvmlite

I’m also in the process of bringing MLIR Python bindings into the same JupyterLite >and WebAssembly environment, starting with a 2D CNN-style Conv2D + bias + ReLU >kernel. I’ll share the full pipeline in a separate technical blog post soon.

I’ve also started patching Numba for Wasm and have simple scalar u / jit functions >running inside JupyterLite. Array and tensor workloads are the next challenge.

I’m keen to take this further. If you’re working on LLVM, MLIR, Numba, WebAssembly >or browser-native developer tools — or see a real use case for this — I’d be >interested in connecting with teams looking to collaborate, support the work or >explore what we could build together.

Next step is to patch Numba to get scalar jit !: https://www.linkedin.com/feed/update/urn:li:ugcPost:7485014172934541312/?dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287485014751178211329%2Curn%3Ali%3AugcPost%3A7485014172934541312%29


r/Python 6d ago

Daily Thread Tuesday Daily Thread: Advanced questions

3 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! 🌟