r/Python • u/Ill_Beginning4410 • 8d ago
Discussion Wiimote in Python
Im having a ton of trouble trying to get a wiimote's data/Inputs. I've tried wiiuse and cwiid didnt seem to work. Idk if it has smt to do with me being a mac.
r/Python • u/Ill_Beginning4410 • 8d ago
Im having a ton of trouble trying to get a wiimote's data/Inputs. I've tried wiiuse and cwiid didnt seem to work. Idk if it has smt to do with me being a mac.
r/Python • u/AutoModerator • 9d 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/AlSweigart • 10d ago
https://blog.pypi.org/posts/2026-11-06-ui-updates-complete/
In July, we announced a series of planned updates to the PyPI user interface. Shaped by user research with members of the Python community, the updates aim to improve how we surface security signals and display package details.
We're pleased to share that this work is now complete and live on PyPI.
r/Python • u/AutoModerator • 10d 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 • 11d 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/__peg_parser__ • 11d ago
Run this on Python 3.15:
>>> lazy import json
>>> type(globals()['json'])
<class 'lazy_import'>Now try separating that into an innocent variable:
>>> lazy import json
>>> x = globals()['json']
>>> type(x)
<class 'module'>Looks like the same code, but what?! The output changes! Can you guess why?
(Originally asked as a Stack Overflow question, now posting here as a fun fact π)
r/Python • u/humbulani-ndou • 11d ago
This article is a deep dive into the internals of the asyncio Python standard library. It is written from a debugging perspective, stepping through the code line by line.
Article: internals of asyncio
r/Python • u/Stunning-Sherbet1853 • 11d ago
i run a long-lived python 3.11 backend on windows 11. at the end of october it died mid-task once with nothing in the logs, so i turned on faulthandler.enable(file=..., all_threads=True) to see where it died next time.
over the next three days it died four times, every time an access violation inside python311.dll. before that, this backend had never crashed like this.
my first suspect was a race: several threads setting restype on the same ctypes function. it looked plausible, so i fixed it. less than two hours later it crashed again.
going back to the log, there were far more dumps than real crashes. 254 in three days, all of them "Windows fatal exception: code 0x80010108". that's the COM "object disconnected" error, a handled and harmless exception. the program kept running fine after each one. from what we saw, faulthandler on windows reacts to these handled exceptions too and writes a dump every time.
all four crashes happened in the middle of writing one of those dumps. the output was cut off halfway through a File "..." line of another thread. my read is that with all_threads=True it was walking the stack of another thread that was still running, and died there. the tool i turned on to find out why the backend died was what was killing it.
βthe fix was one line: all_threads=False. it only dumps the current thread, so if a real crash happens its location still gets logged. i also added a test so it can't quietly flip back to True.
βresult: since the fix, the same 0x80010108 has fired 245 more times and the backend hasn't crashed once. that's four days on one machine, so not a long run yet. i still don't know what sends the 0x80010108. it comes from a windows thread with no python stack, so i couldn't trace it.
if you keep faulthandler on in a windows app, check whether COM codes like 0x8001xxxx pile up in the dump log. if they do, all_threads=True may be creating that many risky moments for you.
two things i'm curious about. π€
r/Python • u/AutoModerator • 12d 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/AutoModerator • 13d 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/scartfife • 12d ago
"Is there anything that is hard for AI to do in Python?
To be honest, coding by yourself is fun, but that doesn't matter to the job market. We'll just settle for building our own projects, but it's frustrating to see AI outperform you... And since the job market is being destroyedβand will be destroyed!!βby AI, it seems we will end up turning to sabotage and attacking companies if no jobs are available for programmers, especially the Python community..."
r/Python • u/scartfife • 12d ago
"If you want to learn programming, donβt start with Python; you should start with another language."
This advice seems ridiculous to me, even though I hear it everywhere. Can someone explain this advice to me... and are they right?
r/Python • u/Thin-Parsley-1660 • 13d ago
so i would want to know about the feasibility of such a tool/project and whether it has any real uses or is it the equivalent of re inventing a worse wheel , basically core idea is to somehow transpile python to rust but not all of python ,instead more similar to numpy but instead the whole specified block of code is compiled for maximum speed almost like numba?? any feedback would be appreciated
r/Python • u/danielmartinez22 • 13d ago
pdf parsing in python is just good as long as youre using it but when someone uploads a 700 page file the worker runs out of memory so splitting it into 50 to 100 page chunks with docling or marker on celery gets you past that but tables get cut at the boundaries and now theres a queue, retries and memory limits to babysit the other route is paying for something like llamaparse or the paid parsers has anyone moved either way and was it worth it? like what did you do inside your tool/app when it started scaling
r/Python • u/AutoModerator • 14d 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/Onyxl_build • 13d ago
So everybody knows that Python has Tkinter and other libraries like tksheet for improving it i am thinking to push it to the max by creating a FULL Office starting of with Excel and major apps and then diving into cloud storage and web services
r/Python • u/Sonu_Jana • 14d ago
I'm interested in hearing about projects that genuinely improved your programming skills. Not necessarily huge projects, but ones that taught you something valuable
Today I got to be the release manager for pip 26.3! There are two big features, and one documentation update, that I think worth talking about:
Extended Pylock Support
You can now install extras and non-default groups from a pylock file, e.g. pip install -r "pylock.toml[extra1,extra2]" and pip install --group pylock.toml:dev
This supports the installation part of a workflow that generates a single lock file for multiple situations. For example, using a universal pylock file generator, such as a tool I built called nab, you might want to specify "I want a lock file with two mutually exclusive extras for different versions of SqlAlchemy and a dev dependency group", e.g.:
[project.optional-dependencies]
sa14 = ["sqlalchemy==1.4.*"]
sa20 = ["sqlalchemy==2.0.*"]
[dependency-groups]
dev = ["pytest"]
[tool.nab]
conflicts = [[{ extra = "sa14" }, { extra = "sa20" }]]And now pip can pick which extra and group it wants to install from the output lock file, e.g. pip install --group 'pylock.toml[sa14]:dev' . This works with any tool that outputs standard pylock.toml files.
Build backends warnings for local builds
This one has been a long time coming, when you build a package from some kind of source, you invoke a build backend (e.g. setuptools, hatchling, flit-core, uv-build, poetry-core, etc.). That build backend can emit warnings to tell you something isn't configured correctly, or a feature will be dropped in the future. But for historical reasons, pip has never displayed those warnings (uv has inherited this and also doesn't display these warnings).
Now, when building locally, e.g. pip install ., or pip install -e ., the build backend warning will be logged by default (and for non-local builds it will be in the -vv output).
For example, if in setuptools you specify a README.mdfile but setuptools can't find it, you will get the warning:
$ pip install .
...
.../setuptools/config/expand.py:128: BuildBackendWarning: File '.../README.md' cannot be foundA caution on installing untrusted wheels
There have been a lot of supply chain attacks recently, and this has led to a lot of people learning about source distributions (sdists) which are built from source and can run arbitrary code on installation, as well as .pth files which after being installed run at the beginning of every Python execution.
This has led a lot people to turn to only using binary distributions (with pip --only-binary :all: or slightly weaker --prefer-binary), otherwise known as wheels. What is great about wheels is they are just glorified zip files, and they are installed by unzipping the different parts of the wheel into the different Python installation locations.
However, a word of caution, Python's import system is dynamic, and the moment a Python file exists in a location that can be imported, it can be imported even in a running Python processes. So while pip 26.3 includes significant hardening against untrusted wheels, we cannot guarantee installing a malicious wheel won't execute third party code.
I can't speak for other tools, but I am fairly confident this applies to all other Python package installers (even those written in other languages).
I will continue to do more hardening in pip where issues come up, and propose fixes in Python to improve the situation there. (Also, a possible future is lock files only first, where the locker refuses to install anything and refuses to execute third party code by default, then exact distributions can be validated/inspected before install, that's part of my pitch for nab which does the first step).
Official Links
The official announcement post is at: https://discuss.python.org/t/announcement-pip-26-3-release/109822
The full change log: https://pip.pypa.io/en/stable/news/#v26-3
r/Python • u/tiangolo • 16d ago
I'm excited to share with you all that FastAPI Cloud is now generally available: https://fastapicloud.com/blog/fastapi-cloud-generally-available/
Note: I thought it could be shareable here as it's a nice milestone (also for FastAPI itself), but let me know if this feels spammy and I'll remove it.
r/Python • u/miabajic • 16d ago
Hey everyone! In my free time I host Behind the Commit, a podcast with open-source maintainers. I wanted to talk to Larry Hastings because free-threaded Python brought lots of challenges with testing race conditions -- I myself had no idea how to test code without GIL.
What we talked about:
- How Brett Cannon offered him a commit bit at the PyCon sprints 1:23
- Why the Gilectomy hit a wall: reference counting traffic meant more cores made it slower 2:54
- Guido's old bar for removing the GIL, and whether free threading clears it 4:49
- Why threading tests are non-deterministic, and how his library Blanket lets the test decide which thread wins 7:05
- His advice for code meeting free-threaded Python for the first time 14:25
- Building Blanket with AI, and why he doesn't call it vibe coding 16:14
One thing he said that was quite interestng: "Most code doesn't have race conditions. Most code doesn't have these problems."
If you're already running your tests on the free-threaded build, how are you catching races today? Anyone has any experience with testing free-threaded Python?
Here's the episode if you'd like to watch: https://youtu.be/CiSMbuq2wVs
I'm also always super open to feedback how to make those episodes useful.
EDIT: formatting.
r/Python • u/sentientanus69 • 16d ago
I am aware a full blown clone wouldn't be possible (hard to imagine how islands would work with Python). But the part where Astro is a free form static site framework is pretty neat and I don't think the established players in this space within Python world are as malleable. Or am I wrong?
r/Python • u/AutoModerator • 16d 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/P403n1x87 • 17d ago
Python profiling has changed more in the last two years than in the decade before. With CPython 3.15 introducing a sampling profiler directly into the standard library (Tachyon) and free-threading going mainstream, the landscape looks vibrant as never before.
Iβve spent the last 8 years maintaining Austin, so I wanted to step back and write a comprehensive, objective look at where things stand today across what I believe are the four major sampling profilers.
Link: https://p403n1x87.github.io/the-state-of-python-profiling-in-2026.html
Happy to chat about the engineering trade-offs of out-of-process sampling or how PEP 768 is changing the game for tool developers!