r/Python

▲ 1 r/Python+1 crossposts

Open Source Contribution

Hey, I am looking for some GitHub repo to contribute this summer, if you have any projects related to Python, Backend (FastAPI), AI agent, then I will be happy to contribute in the long term.

I am specifically looking for an active less crowded repos.

reddit.com
u/DxNovaNT — 5 hours ago
▲ 0 r/Python

Should i buy 100 days of python code by dr angela. Currently its on sale 5$ ?

Should i buy the course in 2026 . I already know python basics till oops . I saw the course structure from outside it looked good. Is it still revelent? Please drop your reviews and guide me

reddit.com
u/Significant-Book6927 — 13 hours ago
▲ 0 r/Python

Curious about Python

I had seen python mentioned in some unix books and some of my old Linux books. I thought it was an ancient language spoken only by high priests now departed. All of my projects (commercial embedded real-time) were in ansi C. The really old stuff was k&r. I'm assuming it executes i-code. I have gigs in my historic projects that I have reuse frequently now archived.

But is Python for me learning now?

reddit.com
u/Secret_Ad_7592 — 18 hours ago
▲ 119 r/Python

Supply-chain attacks are happening daily - add at least dependency cooldown to your Python projects.

These days, I can't open X anymore without seeing some supply chain attacks on PyPI or NPM. Things are really getting out of hand. One very simple yet effective approach to mitigate them is to use a dependency cooldown. That means that you don't install anything that's too new - e.g., every dependency needs to be at least a week old.

Why does this work? Because the community usually intercepts them in hours to days. Both uv and poetry support the definition of the cooldown period inside their config. pip is adding as support as well. I use 1 week to be on the safe side. They both support excluding a specific package from the rule so you can still apply critical fixes to dependencies ASAP.

I wrote about that and how to configure uv/poetry in my blog post: https://jangiacomelli.com/blog/mitigate-supply-chain-attacks-for-python-dependencies/

More about the dependency cooldown concept:

u/JanGiacomelli — 1 day ago
▲ 0 r/Python

Suggest some simple roadmap for python backend

I don't know where to start and how for backend role in python. I am stucked in watching youtube and then thinking is this right path i should follow or I have to move another things to learn first. Suggest some things

reddit.com
u/dehatimemer — 17 hours ago
▲ 0 r/Python

Suggestion we should call python 3.14 pithon

Suggestion:

We should call python 3.14 pithon.

For those who don't understand.

Pi (the math thing) is 3.14

reddit.com
▲ 0 r/Python+1 crossposts

Is PCAP (Certified Associate Python Programmer) enough to start career as Backend Developer?

I don't have a formal degree in IT, but I've been diving deep into fields like RPA, AI agents, LLM fine-tuning, and Machine Learning. According to reports (like UiPath's), Python is pretty much the backbone for all of this.

If you were looking to land a Python Developer role starting from scratch today, would you prioritize certifications like the Python Institute’s PCAP, or would you take a different route?

I’d love to hear your personal stories and what worked for you!

reddit.com
u/Rude_Literature5051 — 1 day ago
▲ 14 r/Python

Monday Daily Thread: Project ideas!

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

reddit.com
u/AutoModerator — 2 days ago
▲ 8 r/Python

Anyone experienced yt clump_find crashes with Parthenon files?

I’m trying to use the clump_find function in yt on my Parthenon .rhdf file, but it crashes immediately when it tries to generate the first contours. Has anyone had this problem? If so, how did you fix it?

To get around it, I regridded the data and it works, but I lose resolution.

reddit.com
u/WolfofRom — 2 days ago
▲ 0 r/Python

Coding assessment interview PYTHON!!

Hi guys hope everyone’s having a wonderful weekend.

Just wanted to ask the experts what’s the best and absolutely free website to train for Coding assessment interview on Python

I have an interview coming up!! ;)

reddit.com
u/Own-Accountant01 — 3 days ago
▲ 0 r/Python

Turning a Python app into a real product feels harder than writing the code

In Python, the actual app construction usually feels pretty straightforward. The hard part starts when you try to turn it into something real people can actually use.

Things like packaging, updates, installers, compatibility issues, access control, managing different systems etc. take a lot longer than I thought they would.

At first, I thought the hard part was finishing the code. But now it feels like everything afterwards is a whole new ball game.

Curious if anyone else who builds Python apps has felt the same.

reddit.com
u/Haunting-Shower1654 — 4 days ago
▲ 6 r/Python

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

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

reddit.com
u/AutoModerator — 3 days ago
▲ 0 r/Python

Hica in comparison to Python

Hej,

I've been working on a language called hica and Python has been one of its inspirations, especially working with lists. I have created a Hica vs. Python comparison at https://cladam.github.io/hica/docs/hica-vs-python and the verdict is ofc Python 🙂

From my conclusion:

>Python is the safe, proven choice with the largest ecosystem and lowest barrier to entry.

>hica emphasises foundations like immutability, type safety, pattern matching, and explicit error handling. Students who learn hica carry these patterns into Python, Rust, TypeScript, or whatever they use next.

>Why not both? Start with hica to build the foundations, then move to Python with a head start on the concepts that matter most.

What does this community think? My Python is a bit rusty, any feedback is welcome.

reddit.com
u/cladamski79 — 3 days ago
▲ 0 r/Python

How to send automated emails from python (No SendGrid, completely free!)

I needed to send ~80 personalized emails to a list of GitHub users a few weeks ago. Different name in each one, different repo reference, written like a person wrote them. The kind of thing you do when you're cold-reaching for a side project.

Every guide I found told me to sign up for SendGrid, Postmark or Resend. Verify a domain, set up DKIM, get on a free tier, hope you don't trip a spam classifier. Half a day of setup for something I needed to do once.

Then I remembered Gmail does this natively. Google has been running an SMTP server at smtp.gmail.com for twenty years and any language with a sockets library can talk to it. The only thing standing between you and sending email from your own Gmail is one settings page most people never visit.
Here's the whole thing.

What you need

A Gmail account with 2-Step Verification turned on. If you don't have 2FA on, go to myaccount.google.com/security and switch it on first, otherwise the next step doesn't exist.

Then go to myaccount.google.com/apppasswords and generate a new app password. Google shows you the 16-character string once, looks like abcd efgh ijkl mnop. Copy it immediately. The spaces are optional, Gmail accepts it either way. Treat this like a password — don't commit it, don't paste it in chat, don't put it in a Notion doc your team can read. Google's scanners catch app passwords leaked in public repos and auto-revoke them, but the lag is unspecified and you really don't want to find out the hard way.

That's it for setup. Now you can send email.

The minimal version

Ten lines of Python. No libraries beyond the standard library.

python
import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg["From"] = "you@gmail.com"
msg["To"] = "recipient@example.com"
msg["Subject"] = "hello"
msg.set_content("Body goes here.")

with smtplib.SMTP("smtp.gmail.com", 587) as smtp:
smtp.starttls()
smtp.login("you@gmail.com", "abcd efgh ijkl mnop")
smtp.send_message(msg)
Run it. An email leaves your Gmail and shows up in the recipient's inbox a few seconds later, looking exactly like one you typed by hand. That's the whole protocol. Everything else is wrapping that in a workflow.

If port 587 is blocked on your network (corporate Wi-Fi, some hotels), switch to port 465 with smtplib.SMTP_SSL instead of STARTTLS. Same protocol, different transport, one line change.

The pattern for sending to a list

For real outreach you need three files: a .env for the Gmail address and app password, a recipients.csv with name and email columns, and a template.txt where the first line is the subject and the body uses {name} placeholders. The script reads all three, renders an email per recipient, has a dry-run flag that prints everything without sending, asks for a y confirmation if it's a live send, and then sends one at a time with a 4-second delay between each.

The dry-run flag matters more than it sounds. The number one mistake is a typo in your template — {nmae} instead of {name} — and Python's string formatter will quietly send the literal {nmae} to all 80 recipients. A dry-run that prints every rendered email to your terminal catches this in five seconds and saves you the apology email. Always dry-run first.

The whole script is about 120 lines of stdlib Python. I keep the working version saved as an npad here: https://npad.run/p/how-to-send-emails-using-gmail-programmatically-sgkbrkxaxs. If you have Claude Code or Cursor, paste that URL and tell your agent to set this up. It'll write the script, the env, the CSV format, and the template. One shot, no copy-pasting from this article.

Things to know before you live-send

A few things I learned the slightly painful way that aren't obvious from the docs.

Send one email per recipient, not one BCC'd to everyone. BCC blasts look like spam to filters, and some email clients reveal the BCC list anyway, which is how you accidentally show 50 strangers each other's addresses. Sending one at a time means each person sees only their own address and it looks like you actually wrote to them.

Put a real delay between sends. 4–5 seconds is the sweet spot. Faster and Gmail starts returning 421 4.7.0 errors that mean "you look like a bot, slow down." Don't try to be clever about parallelism — Gmail's free tier wants quiet, polite traffic, not a burst of fifty messages in three seconds.

Add a confirmation prompt before sending. "About to send to 80 recipients. Continue? [y/N]" is the cheapest insurance you'll ever write. The day you accidentally point the script at the wrong CSV, that prompt is what saves you.

Limits

Free Gmail will let you send around 500 emails per day before it starts pushing back. Workspace bumps that to 2,000. If you need more than that, you're at the volume where SendGrid or Postmark actually starts to make sense — they exist because at scale you do need bounce handling, deliverability monitoring, and a warmed-up sender reputation. But for under 500 emails a day of personalized outreach, Gmail is genuinely fine. Better than fine actually — it lands in inboxes more reliably than a cold ESP IP because Gmail has spent twenty years building sender trust on its own infrastructure.

btw if you really want to push past the daily cap, you can rotate keys across multiple Gmail accounts. hehe.

reddit.com
u/Veerbhadra_1 — 4 days ago
▲ 44 r/Python

Polars code runs slower on 128-core EC2

Disclaimer: I am not sure this post is appropriate for r/LearnPython since it's not a question of "how to do something in Python", rather I am looking for a lower-level discussion for why my Python application performs poorly on a significantly more powerful server. Hence I'm posting it here.

The problem:

I have a relatively complex data pipeline that is written in Polars. On my local machine with 12 cores, the pipeline finishes in about 1200ms. On my 128-core EC2, it takes 13000ms to complete. I have tried setting the POLARS_MAX_THREADS parameter to 12 on the EC2, and it's still slower.

I am using a TMPFS partition on both machines to read the data into the pipeline directly from RAM. Both my machine and the EC2 have DDR5 RAM so I think they should be comparable.

Anyone have any ideas why the pipeline would run much slower on the EC2?

reddit.com
u/Popular-Sand-3185 — 6 days ago
▲ 5 r/Python

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

reddit.com
u/AutoModerator — 4 days ago
▲ 2 r/Python+3 crossposts

Pulumi Gcp And Python Up And Running

I focus on the practical path to getting started quickly while still building a solid foundation. That includes setting up the Pulumi project, configuring the GCP provider, working with a Python-based infrastructure definition, and understanding how Pulumi tracks state and applies changes. I also cover the basic developer workflow for previewing updates, deploying resources, and making iterative changes safely. The goal is to make the first experience with Pulumi and GCP feel approachable, especially if you already know Python and want to use that skill set to manage cloud resources.

youtu.be
u/Efficient-Public-551 — 4 days ago
▲ 172 r/Python

[Ann] Pyrefly v1.0 (fast type checker & language server)

Hi, Pyrefly maintainer here. Today we are pleased to share that Pyrefly, a fast type checker and language server for Python, has reached stable v1.0 status, meaning we are confident that Pyrefly is ready for production use.

Pyrefly was first released as an alpha in mid-2025 and followed up with a beta in November of that year. Since then, we have shipped over 60 minor releases: fixing hundreds of bugs, adding the features you’ve been asking for, and improving performance to be one of the fastest tools out there.

This would not have been possible without our amazing open-source community. To everyone who filed GitHub issues, submitted pull requests, gave us feedback at conferences, or joined us on Discord: thank you. Your contributions shaped this release, we’re grateful for every one of them, and we hope you continue being a part of the journey for future releases too.

We've published a blog post explaining what v1.0 means exactly, and what's next for Pyrefly.

Below is a summary of the changes to Pyrefly since the Beta release. The full release notes for v1.0 can be read on our Github.

Pyrefly v1.0 Release Notes

Performance Improvements

We've continued to push Pyrefly's performance since the speed improvements we shared in February. Since beta:

  • 2–125x faster updated diagnostics after saving a file (no, that’s not a typo!). Thanks to fine-grained dependency tracking and streaming diagnostics, updates now consistently arrive in milliseconds
  • 20–36% faster full type checking on large projects like PyTorch and Pandas
  • 2–3x faster initial indexing when Pyrefly first scans your project
  • 40–60% less memory usage during both indexing and incremental type checking

(Tested on an M4 Macbook Pro using open-source benchmarks from type_coverage_py and ty_benchmark.)

Compare the performance of Pyrefly and other Python type checkers on our regularly updated benchmarking suite, which runs against 53 popular Python packages.


Configuration Presets

A new preset configuration option provides named bundles of error severities and behavior settings.

Preset Description
off Silences all diagnostics. Useful for IDE-only users or if you want total control of which errors are enabled.
basic Low-noise, high-confidence diagnostics only (syntax errors, missing imports, unknown names, etc.). Ideal for unconfigured projects or IDE-first users.
legacy For codebases migrating from mypy. Disables checks mypy doesn't have. pyrefly init now emits this preset automatically when migrating from a mypy config.
default The standard Pyrefly experience. Equivalent to having no preset.
strict Enables additional strict checks on top of the default preset. For users who want to avoid Any types in their codebase.

See the configuration docs for details.


Onboarding Experience

We’ve made improvements to the out-of-the-box experience for projects without a pyrefly.toml.

  • Automatic config synthesis — if you have a mypy or pyright config, Pyrefly automatically migrates your settings and synthesizes an appropriate in-memory Pyrefly config. (This is the same migration that pyrefly init would commit to disk.)
  • Basic preset for unconfigured projects — projects with no type checker config get the lightweight “basic” preset, which surfaces only high-confidence errors.
  • VS Code status bar — the status bar shows the active preset — e.g. Pyrefly (Basic) or Pyrefly (Legacy) — so you always know which mode is active.
  • Type error display settings — new VS Code settings let you control which preset applies to unconfigured files and suppress all diagnostics workspace-wide.

Type Checker Improvements

We've been hard at work making the type checker robust and feature-complete, with a focus on driving down false positives and improving type quality in real-world code bases. Here are some highlights:

  • Across the board we've eliminated many sources of false positives in enums, dataclasses, ParamSpec, descriptors, and more.
  • Support has been added for more type narrowing patterns, including preserving narrows in nested scopes and recognizing container membership checks.
  • Overload resolution was substantially reworked to handle more real-world patterns.
  • Pyrefly’s conformance to the Python typing specification has improved from 70% at beta to over 90% today.
  • We've added experimental support for tracking tensor dimensions through PyTorch models — see "What's Next" below.

LSP & IDE Improvements

  • We've added new refactoring capabilities like Safe Delete (with reference checking) and bulk source.fixAll.
  • Navigation is more precise, and hover cards surface richer information for imports, tuples, and NamedTuples.
  • Workspace mode is more stable, with multiple crash fixes and improved diagnostic publishing.

Framework & Notebook Support

  • Django — Pyrefly has improved support for model relationships, fields, and views, and understands factory_boy factories.
  • Pydantic — Pyrefly models Pydantic's runtime behavior more faithfully, with support for lax mode and range constraint validation, and handles more of the Pydantic ecosystem: RootModel, pydantic-settings, and pydantic.dataclasses.
  • Pytest integration — We've added Code Lens run buttons for test functions, as well as code actions to annotate fixture return types and parameters.
  • Jupyter notebooks.ipynb IDE support has reached full parity with .py files, with rename, find references, code actions, and document symbols all supported.

Complementary Tooling

Pyrefly ships with tools to aid with adopting type checking in an existing codebase. Two new tools since beta:

  • pyrefly coverage report outputs a JSON report with annotation completeness and type completeness metrics per function, class, and module, so you can track coverage over time.
  • Baseline files let you snapshot current errors into a JSON file so only new errors are reported, as an alternative to inline suppression comments.

Updated Version Policy

Going forward, we’ll switch from a weekly to monthly cadence for minor (1.x.0) releases, with patch releases in between as-needed for critical fixes. We’ll continue providing release notes for minor versions, so you can see what’s new in each release.


What's Next

  • Tensor shape checking — Experimental support for tracking tensor dimensions through PyTorch models and catching shape mismatches statically. Learn more.
  • Pyrefly + AI agents — Pyrefly's speed makes it a natural verification step in agentic workflows. See our guide on adding Pyrefly to your agentic loop.
  • Continued improvements — We'll keep expanding library support, reducing false positives, and iterating on your feedback. Let us know what you need on Github or Discord.
reddit.com
u/BeamMeUpBiscotti — 7 days ago
▲ 16 r/Python

I hate code written by LLMs

Hi everyone,
I am a Data Science student and I am far away from considering myself a "good coder", as I think I miss many fundamental concepts and I do not know a lot of standard good practices. Hence, I wanted the opinion from people with greater expertise in the field. Is it only me who hates how LLMs write code? I am not able to understand it properly, and I always have the feeling it is overcomplicating logics and processes that are in actually very simple, making a script 5 times its actual lenght.

I often do group projects with colleagues of mine, which I am now pretty sure do not even check the code the agent writes for them and it is always very frustrating to navigate in the maze of newly created functions and files which always feel redundant and inefficient.

In particular, I hate these features:
- They tend to go on a newline everytime there is a list of parameters, even when it is not necessary.
- Tthey do not comment nothing and if they do the comments are too long and too technical
- They declare way too many functions. I was thought that the main goal of functions was reusability. What is the purpose of having a function that you only call once? Maybe they even call that function "run_analysis_xyz". What is the purpose of that? Why do you have to prefer a code which is nested and does not execute top to bottom, in the same way that a reader can follow it?
- The variables naming rarely reflct their actual purposes.
- Unecessaries safety checks, that are good for general code but they make no sense

I am starting to hate group projects for this reason. I just get nervous when I try to read code that is clearly generated. Am I wrong for using AI just as an assistant and not as a completely autonomous code writer?

reddit.com
u/Puzzleheaded_Dig6941 — 6 days ago
▲ 13 r/Python

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

reddit.com
u/AutoModerator — 5 days ago