r/Python • u/AffectionateYak7537 • 10d ago
Resource Tell me what python code to mess a round
Type a random python code in the comments to mess around for a flight that’s coming up soon and I really wanna mess a round with some python cod
r/Python • u/AffectionateYak7537 • 10d ago
Type a random python code in the comments to mess around for a flight that’s coming up soon and I really wanna mess a round with some python cod
r/Python • u/Ishannaik • 11d ago
I ship a desktop app with a python backend frozen with pyinstaller, currently unsigned. Two problems on Windows:
I'm about to pay for signing, and the part I can't find a straight answer on is the pyinstaller side:
If you've been through this, what did your build pipeline end up looking like?
r/Python • u/alexis_placet • 11d ago
Hi,
I'm sharing a blogpost about how we are now able to use PyTorch or Jax in your notebook in the browser ! : https://notebook.link/blog/train-in-your-tab/
Here some examples (be sure to use a WebGPU compatible browser):
r/Python • u/memameola • 11d ago
Hey r/Python! I wanted a way to automatically turn long YouTube videos into vertical 9:16 clips without paying for LLM APIs or running heavy PyTorch models on an old laptop.
How Max Clipper works under the hood:
- Explainable Clip Picking: Uses deterministic DSP and statistical heuristics (hook, audio energy, pacing, heatmap) instead of black-box LLMs—same input always gives the exact same output.
- Low-Spec Optimization: Built and tested on a 4th-gen Intel i5 with 8GB RAM and no GPU. Uses a global render lock to prevent FFmpeg CPU starvation, stall-based timeouts, and -preset ultrafast on <= 4 cores.
- Packaging: One-command installers for Linux/macOS/Windows plus Docker support.
Source Code (MIT License): https://github.com/4hmed1/MaxClipper
Would love code review or feedback on the clip-scoring heuristics!
r/Python • u/AutoModerator • 12d ago
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
Let's deepen our Python knowledge together. Happy coding! 🌟
r/Python • u/AutoModerator • 13d ago
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.
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
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
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 • u/AutoModerator • 14d ago
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!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
r/Python • u/AutoModerator • 15d ago
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!
Share the knowledge, enrich the community. Happy learning! 🌟
r/Python • u/Business-Feedback635 • 15d ago
Python runs any line that starts with import in a .pth file in site-packages, every time it starts. You don't have to import the package. This year, the malicious releases of litellm (March and October) and agent-framework (November) all used a .pth file, so installing them was enough to run the credential stealer.
I wanted to see how many ordinary packages use the same feature. I took the latest release of 354,763 PyPI projects, found every .pth file with an import line, downloaded them and read them. The results:
.pth file that runs on every Python start.-nspkg.pth).urllib3 folder at startup.import lines (PEP 829), and 3.18 will ignore them. Only 13 of the 244 packages already ship the replacement .start file.The post includes a command that lists the .pth files with import lines in your own environment, and a table of what the 15 most downloaded ones do: https://py-code.org/blog/python-pth-files-pypi/
r/Python • u/Beginning-Fruit-1397 • 15d ago
Each time l see this sub it's about wathever package I don't use that got compromised which I couldn't care less about. Now that all code showcase are banned, the new ways for sloppers to feel seen is report security issues. At least the former was still related to code, cybersecurity is another thing completely. I'd rathet see slop code showcases than a boring report about x package hacked
r/Python • u/AutoModerator • 16d ago
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!
Let's keep the conversation going. Happy discussing! 🌟
r/Python • u/enterthearena44 • 16d ago
I was reading about yesterday's Microsoft Agent Framework security incident, and something caught my attention.
Apparently, attackers published two malicious versions (1.26.1 and 1.26.2) of Microsoft's official Python package on PyPI. These versions could steal cloud credentials just by starting Python.
Both versions were removed quickly.
What surprised me was that the malicious code wasn't even checked into Microsoft's GitHub repository.
From what I understand:
- Developers write code in GitHub.
- CI/CD builds it into a Python wheel (.whl).
- The wheel gets published to PyPI.
- When we run "pip install", we download that package.
But apparently, someone with the right publishing credentials can upload a malicious wheel directly, without going through the original GitHub repository.
That raises some interesting questions:
I'm still learning about software supply-chain security, so I'd love to hear how experienced Python developers and security engineers think this should work.
r/Python • u/OriginalHistorian522 • 17d ago
Hey everyone! If you’re a college student interested in Applied AI Engineering, Cybersecurity, Web Development, or Technical Interview Prep, check out CodePath’s free Spring 2027 courses.
I’m a Tech Fellow (TF) teaching Technical Interview Prep (TIP), and I highly recommend it if you want to learn data structures and algorithms in Python or get more comfortable with coding interviews. We practice breaking down problems, choosing the right data structure, and explaining our reasoning out loud. That last part makes a big difference when an interviewer asks you to walk through your approach.
If you’re interested, apply to CodePath here. That’s my referral link.
Happy to answer questions about TIP or what it’s like to take the course!
r/Python • u/AutoModerator • 17d ago
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.
Let's help each other grow in our careers and education. Happy discussing! 🌟
r/Python • u/BattleRemote3157 • 17d ago
1.26.1 and 1.26.2 both ship a credential stealer. It runs from a .pth file, so it executes at interpreter startup. Nothing has to import the package, a pip install in CI is enough. 1.26.1 got pulled, then 1.26.2 went up 33 minutes later with the same payload under different file names. Last clean release is 1.26.0.
complete details- https://safedep.io/blog/microsoft-agent-framework-pypi-compromise
r/Python • u/AutoModerator • 19d ago
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
Let's deepen our Python knowledge together. Happy coding! 🌟
r/Python • u/Impossible-Ad-6925 • 19d ago
What My Project Does
git-wrapped reads your local git history and gives you a "year in review": a colored contribution heatmap in your terminal, plus a shareable 1080x1350 card (SVG or PNG) with your commits, active days, longest streak, peak coding hour, top languages and a "persona" for your year (Night Owl, Early Bird, Weekend Warrior...).
It can scan a whole folder of repos at once and de-duplicates commits.
Target Audience
Any developer who wants a fun, shareable recap of their year. It's a hobby/side project, not production tooling.
Comparison
Many GitHub stats widgets rely on the GitHub API and a token. git-wrapped only runs `git log` locally, so it works offline, with private repos and non-GitHub repos, and it has no Python dependencies (PNG export uses a renderer you already have, like Chrome or rsvg-convert).
Usage
pip install git+https://github.com/Mohammadsdq/git-wrapped
git-wrapped ~/projects --year 2026 --png
My own year, for fun: 74 commits, peak hour 11pm, favorite commit word "upload" (10x). Apparently I'm a "Steady Builder".
Repo: Github Repo
r/Python • u/AutoModerator • 20d ago
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.
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
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
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 • u/AutoModerator • 21d ago
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!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
r/Python • u/Ashamed-Calendar-139 • 20d ago
Hey folks! I’ve been playing with agentic coding and wondering if it’s actually worth adding Python-specific skills to my setup.
For those of you using them: which ones are genuinely useful? Any examples where a Python-specific skill noticeably improved the result vs just letting the agent figure things out on its own?
r/Python • u/AutoModerator • 22d ago
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!
Share the knowledge, enrich the community. Happy learning! 🌟
r/Python • u/Sensitive-Raccoon155 • 22d ago
I'm using PyCharm with Python 3.13 and trying to implement a generic CQRS pattern.
I explicitly specify int as the response type, but PyCharm doesn't report any error when the handler returns str.
from abc import ABC, abstractmethod
from typing import Generic, TypeVar
TCommand = TypeVar("TCommand", bound="Command")
TResponse = TypeVar("TResponse")
class Command(ABC, Generic[TResponse]):
pass
class CommandHandler(ABC, Generic[TCommand, TResponse]):
@abstractmethod
async def handle(self, command: TCommand) -> TResponse:
pass
class CreateUserCommand(Command[int]):
pass
class CreateUserCommandHandler(CommandHandler[CreateUserCommand, int]):
async def handle(self, command: CreateUserCommand) -> str:
return "123"
Is this expected behavior, or am I missing something in my generic type definitions?
r/Python • u/Quantititoo • 23d ago
I keep hearing that AI now writes most of the code at some companies. For people actually shipping Python with Claude Code, Cursor or Copilot:
Context: I work in risk and data and am deciding what to get good at next. Real examples would help more than opinions. Thanks!
r/Python • u/AutoModerator • 23d ago
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!
Let's keep the conversation going. Happy discussing! 🌟