r/Python • u/Pescadorcito • 22h ago
Discussion Pyinstaller for android?
Hello friends, is there any way to make an APK from Windows or another operating system using a Python library similar to PyInstaller?
Convert .py in .apk?
r/Python • u/AutoModerator • 1d 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/AutoModerator • 11h 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/Pescadorcito • 22h ago
Hello friends, is there any way to make an APK from Windows or another operating system using a Python library similar to PyInstaller?
Convert .py in .apk?
r/Python • u/dasMoorhuhn • 13h ago
I made myself a lib for fast parsing RAW images from my sony camera.
My old code: ```python def check_for_endian(data:bytes) -> tuple[int, int]|None:
if data[:2] == 0x4949: # "II" LE
return 1, 0
if data[:2] == 0x4D4D: # "MM" BE
return 2, 0
return None
So it was possible to compare a hex value with bytes. Now it's not possible anymore, somehow, so I had to do this:
python
def check_for_endian(data:bytes) -> tuple[int, int]|None:
header_endian = struct.unpack_from("<h", data, 0)[0]
if header_endian == 0x4949: # "II" LE
return 1, 0
if header_endian == 0x4D4D: # "MM" BE
return 2, 0
return None
```
I'm a bit confused, have I used it wrong in the first place and I was never supposed to compare a hex value with bytes?
E: I use python 3.13.9 and uv 0.9.9
r/Python • u/david_vael • 2d ago
Hey everyone,
Chapter 3 is finally done. This chapter took way more time than I originally expected because it grew into a much deeper and larger chapter than planned.
Current Progress:
β
Chapter 1 - Variables & Memory
β
Chapter 2 - Expressions & Operators
β
Chapter 3 - Conditional Statements & Control Flow
I'd love to hear your thoughts on the new chapter and any suggestions for future improvements.
With this, Iβm taking a break from Python Under the Hood. Iβll be stepping away from the project for a while and will return to it before July 2027.
When I come back, weβll continue with even deeper explanations, more advanced topics, and an even better approach to understanding what happens under the hood of Python.
For now, Chapter 3 marks the end of this phase. πβοΈ
GitHub:Β python-under-the-hood
See you in the next chapter.
r/Python • u/pkhatri9 • 3d ago
I've been thinking about concurrency control in asyncio.
A common pattern for limiting concurrent work is:
sem = asyncio.Semaphore(10)
async with sem:
await do_work()
But in many cases, couldn't the same problem be modeled by putting work into an asyncio.Queue and running a fixed number of worker tasks?
I'm curious how experienced Python developers decide between the two approaches.
Are there real-world situations where a semaphore is clearly the better abstraction than a worker queue? Are there meaningful differences in cancellation behavior, backpressure, fairness, task lifetime, or code complexity?
I'd especially be interested in examples from production async Python code.
r/Python • u/Spirited_Parsley_222 • 3d ago
Below is the link for Python enthusiasts and programmers/anyone interested in the Pycon 2026 event, which will take place in Aveiro from September 3rd to 5th!
r/Python • u/novadiony • 4d ago
Hello!
I'm Nova, I'm a college student taking CS in Norway. And I just wanted to share a bit of my story.
I started my developing career roughly 7 years ago when I was 8-9. I remember watching so many movies about these hackers and programmers growing up, and thinking "Wow, I wish I could be like them!". Luckily my father had a computer science background himself! So he saw this and showed me a couple things such as Scratch, blablabla.
I quickly quit Scratch, cause I thought it was boring and hard. But just a few months later, I installed Python and VSCode on the family computer! I started watching a multi hour Python course by Programming with Mosh and followed along. I remember being so bored haha!
But it clicked. It really did. It scratched (pardon the pun) something that Scratch couldn't. Some abstract yet so understandable logic. At the time it really felt like I was on top of the whole world.
Somewhere in the second last to last years of primary school, I was fully invested. I was making calculator apps and whatever I could think of during the free time at school with the provided iPads that hadn't been there the year before. Heck! I got some other kids in my class to become interested in programming too!
Eventually, a year later when I started middle school/high school (combined into the same three years in Norway), I naturally started learning new things such as Java and C# .NET. My Python usage was mostly just small prototypes for other languages at that time.
Yet I never abandoned it. Not even now.
Python is what started my journey, and I am so grateful for everything it has done.
So thank you,
Thank all of you,
Thank you every random StackOverflow member who posted weirdly specific help threads.
Thank you every StackOverflow member who responded to my silly little questions.
Thank you to all the Python maintainers and contributors.
Thank you Guido van Rossum for founding the language.
And thank you to the whole Python community who made this student's childhood dreams possible and bloom to life.
- Nova
r/Python • u/AutoModerator • 3d 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/techiebaddie • 3d ago
I know Iβm a little late to this, but Iβve been looking into Python 3.14.7 and something keeps bothering me.
The release itself looks solid. Python 3.14.7 was released on August 5 and is mainly a maintenance release with a lot of bug fixes and improvements.
But for people working on existing projects, the bigger question seems to be:
What makes you decide that itβs finally time to upgrade Python?
A new Python version sounds great until you have to check:
And Python 3.14 has some pretty interesting changes compared with 3.13, including officially supported free-threaded Python, t-strings, multiple interpreters, and the new compression.zstd module.
So Iβm curious about real-world experience rather than release notes.
Have you upgraded to 3.14 yet?
If yes, what went smoothly and what broke?
If no, whatβs the main reason youβre waiting?
https://alexalejandre.com/interviews/interview-with-nathan-goldbaum/
After a lot of effort, the free threading build works but there is still much community work, making packages compatible etc.
r/Python • u/AutoModerator • 4d 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 • 5d 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/DxNovaNT • 5d ago
I am recently came across the library pyperf because I have to benchmark my changes in a certain open source project to add metrics to the PR I was creating for the changes, but one thing I feel off is types, I don't know why but pyperf has lot of unknown types which is kind of weird so I was planning to contribute to it to make it a little bit better typed.
So I am wondering do projects like pyperf which comes under pdf accept contribution in generally? If there are any maintainers/contributors of pyperf here then then could answer my question.
Thanks in advance.
My Dev Environment
OS: Windows
Type Checker: Pyrefly
r/Python • u/AutoModerator • 6d 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! π
Python 3.15 has reached Release Candidate 1, and the final release is expected on October 1, 2026.
I went through the changes and tried to summarize the ones that seem most relevant for everyday Python development without going through all the PEP numbers.
- Faster startup with lazy imports
Python 3.15 introduces lazy imports, which means some modules can be loaded only when they are actually needed instead of being loaded immediately.
This could help applications and CLI tools that spend a noticeable amount of time importing modules before doing any actual work.
- UTF-8 becomes the default
UTF-8 is becoming the default encoding, which should reduce encoding-related problems, especially when code is running on different operating systems.
This should make situations where something works on one computer but fails because of a different system encoding less common.
- Built-in immutable dictionaries
Python 3.15 adds a built-in "frozendict"-style immutable mapping.
Similar to how a tuple provides an immutable alternative to a list, this gives Python developers a standard way to work with dictionaries that cannot be modified.
- JIT improvements
The JIT compiler continues to improve in Python 3.15.
Early benchmarks show performance improvements in some workloads, including roughly 8β9% on Linux and larger improvements in some Apple Silicon tests.
These numbers will obviously depend on the workload, so I would wait for more benchmarks before making broader conclusions.
- New profiler: Tachyon
Python 3.15 also introduces Tachyon, a new sampling profiler designed for very low overhead.
It can sample running programs at very high frequencies and can also be attached to an already-running process.
This could be useful for finding performance problems without having to restart an application with a profiler attached from the beginning.
- Some terminal improvements
The interactive Python experience is getting a few smaller improvements, including colored error messages and prompts.
The "sqlite3" command-line interface also gets SQL keyword completion.
- Free-threaded Python is still opt-in
Python 3.15 does not make the no-GIL/free-threaded build the default.
It is still something you have to explicitly use.
However, free-threaded Python is becoming more mature, including improvements to ABI support that should make it easier for C extension developers to support it.
Overall, Python 3.15 doesn't look like a release that completely changes how Python is written. Most of the changes are focused on performance, tooling, and improving some long-standing parts of the language.
Since this is already RC1, the major feature set should be mostly locked and the remaining work should mainly be bug fixes and final polishing.
Has anyone here been testing the Python 3.15 beta or RC?
I'm especially interested in whether lazy imports have caused compatibility problems with existing projects.
r/Python • u/Matiiss007 • 7d ago
Ease into fall with this year's hot summer jam. Enjoy 3 weekends of creative thought and maybe even win some prizes. π
The jam's page on itch.io: https://itch.io/jam/the-long-pygame-summer-jam
Join the Pygame Community discord server to gain access to jam-related channels and fully immerse yourself in the event: https://discord.com/events/772505616680878080/1540092982907371521
For discussing the jam and other jam-related banter (for example, showcasing your progress): #jam-discussion
From 28 August 2026 at 19:00 (UTC) to 14 September 2026 at 19:00 (UTC)
Voting ends 21 September 2026 at 19:00 (UTC)
Prizes:
- π₯ 2 Months of Discord Nitro
- π₯ 1 Month of Discord Nitro
- π₯ 1 Month of Discord Nitro Basic
Note that for those working in teams, only a maximum of 2 Nitro subscriptions will be given out for a given entry
The voting for the jam theme is open (requires a Google account, the email address WILL NOT be collected): <see jam page for the link>
Summary of the Rules
- Everything must be created during the jam, including all the assets (exceptions apply, see the jam page for more details).
- pygame(-ce) must be the primary tool used for rendering, sound, and input handling.
- NSFW/18+ content is forbidden!
- You can work alone or in a team. If you don't have a team, but wish to find one, you are free to present yourself in #jam-team-creation
- No fun allowed!!! Anyone having fun will be disqualified! /s
Links
Jam page: https://itch.io/jam/the-long-pygame-summer-jam
Discord event: https://discord.com/events/772505616680878080/1540092982907371521
r/Python • u/AutoModerator • 7d 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/Technical-Ad-565 • 6d ago
UPDATE: I have temporary solved my immediate problem with using the find and diff commands from Termux.
This got me a usable list of differences. Although I had to move folders around a bit.
In the long run I will use Python for this and further functions.
END UPDATE.
I need to make a program fΓΆr comparing file names and subfolder names between 2 folders containing something like 100000 files and subfolders. And it's around 650GB of data on the phone.
(Background: I have programmed professionally since 1979, but not on android or pc. Are totally new to Python. I use the phone almost always, very rarely the pc, even for my own business.)
I have searched for and tried extensively with apps for android but there isn't any useful. Apparently mainly due to permission problems.
The main question is: is it at all possible due to the permission problem?
(The solution by transferring the files to the pc have the problem that it takes very long time. And I really want a way to do it relatively often.)
The second question is: are the any existing code (snippets) for this or have you some advices in general?
Thanks on advance for any suggestions.
//Thomas
r/Python • u/SheriffRoscoe • 8d ago
As someone who spent decades in the mainframe community, I find it ... humorous ... that there are legacy Python2 code bases that are only just (or have yet to consider!) moving to Python3.
https://www.eveonline.com/news/view/the-move-to-python-3-begins
Pythonβs JIT compiler has been experimental since Python 3.13, but Python 3.15 is an important step in its development. The first release candidate, Python 3.15.0rc1, was released on August 4, 2026, with the final release expected in October. The main change is not simply the presence of a JIT, but a substantial improvement in how it observes and optimizes Python code.
The 3.15 JIT now uses a new tracing frontend that records the execution paths a program actually takes. This gives the compiler better information about which operations are important and which paths should be optimized. Earlier versions had more limited information about the code being executed. The improvement itself is not the main performance gain, but it provides a better foundation for the optimizations that follow.
One of the more practical improvements is basic register allocation. Earlier JIT-generated code moved many intermediate values through memory between operations. Python 3.15 can keep some of these values in CPU registers across multiple operations instead. This reduces unnecessary memory traffic and is particularly useful for code with repeated arithmetic and other tight loops.
Reference counting is an important part of CPython's memory-management system, but it also creates work for the CPU. The new JIT can remove some reference-count operations when it can prove that they are unnecessary. This allows compiled code to spend more time doing the actual work rather than repeatedly maintaining object lifetime information.
The JIT also introduces in-place optimizations for some int and float operations. When the compiler can determine that an object is not being referenced elsewhere, it can avoid creating another object for every operation. This is particularly useful in numeric loops where the same values are updated repeatedly.
The current pyperformance results show roughly 8β9% geometric-mean improvement on x86-64 Linux and around 12β13% on AArch64 macOS, compared with the corresponding non-JIT interpreter configurations. These numbers are useful indicators of progress, but they should not be read as a general claim that every Python program will become 10% faster. The actual effect depends heavily on the workload.
Despite these improvements, the JIT is still disabled by default. It is intended for experimentation and benchmarking rather than being something most production applications should enable without testing. Some of its interfaces are also explicitly marked unstable, which reflects the fact that the implementation is still evolving.
The technical progress is only half of the story. On June 8, 2026, the Python Steering Council paused new JIT development on CPython's main branch and asked the developers to present a formal plan for the project's future. This resulted in PEP 836, βJIT Go Brrr: The Path to a Supported JIT Compiler for CPython.β The proposal describes a multi-release roadmap with measurable performance targets, including a proposed 20% geometric-mean improvement on the pyperformance suite for JIT plus free-threading by Python 3.17.
As of August 2026, PEP 836 is still under discussion rather than being a settled decision. That makes the current state of CPython's JIT unusually interesting: the implementation is considerably more capable than it was in its early releases, while its long-term place in CPython is still being decided.
For now, Python 3.15 looks less like the moment when βPython gets a JITβ and more like an important experiment in whether a JIT can become a reliable part of CPython's execution model.
r/Python • u/AutoModerator • 8d 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/Independent_Heart_15 • 9d ago
You can find it at: https://docs.python.org/3.16/library/time-complexity.html
Seen on Mastodon: https://mastodon.social/@stanfromireland/117152534136172516
r/Python • u/PrincipleNo2328 • 8d ago
Pyrefly is a new language server pubblished a week ago.
Has anyone tried it?
I was randomly looking for a new python language server before switching to vs codium and found it.
EDIT
Aparently it's not new, I'm just a bit dumb
r/Python • u/LeatherNatural6511 • 9d ago
A note before you read:
The idea and feature concepts behind Rundesk are mine. I used AI to help organize and explain the idea below.
Rundesk is a lightweight Python development utility that brings Python version management, virtual environments, packages, dependency checking, and program execution into one GUI.
It is not meant to replace VS Code, PyCharm, or your preferred code editor. You keep writing code wherever you like; Rundesk focuses on everything around running and managing your Python projects.
Rundesk would let you manage multiple Python installations and virtual environments through a GUI.
You could easily see and select:
Python version β Virtual environment β Project
A project can be associated with its appropriate Python interpreter and environment without manually switching between environments in a terminal.
Instead of manually using commands such as pip install, Rundesk would provide a GUI for managing packages inside the selected virtual environment.
You could:
The goal is to make package management easier without accidentally installing something into the wrong Python environment.
Rundesk would continuously check whether the project's environment matches its declared requirements, such as a requirements.txt.
For example:
Project requires:
numpy==2.1.0
pandas==2.2.3
requests==2.32.3
Current environment:
numpy 1.26.4
pandas not installed
requests 2.32.3
Rundesk could show:
The button would attempt to synchronize the environment with the project's requirements.
Rundesk would provide an easy way to run, stop, and restart Python programs using the project's selected environment.
It would also display live program output so you don't have to repeatedly open a terminal just to see what your program is doing.
While a program is running, Rundesk could display information such as:
Status: RUNNING
CPU: 12%
RAM: 183 MB
> program output...
Rundesk would have a small Compact Mode designed to sit beside your normal code editor.
The idea is that you could keep an eye on:
without having a huge second IDE covering your screen.
Rundesk isn't trying to become another giant IDE.
Instead:
You write code in your preferred editor.
Rundesk manages the Python environment around it.
The overall workflow is:
Project β Python β Virtual Environment β Packages β Dependencies β Run β Monitor
If Rundesk existed and worked reliably as described, would you use it?
A. Yes β I'd probably use it regularly
B. I'd try it, but I'm not sure I'd switch
C. Maybe β only for certain projects
D. No β my current workflow is already better
E. I don't use Python enough to need it
Which feature would make you most likely to use Rundesk?
What would Rundesk need to do differently for you to consider using it?
What Python tools do you currently use?
For example: VS Code, PyCharm, terminal/pip, uv, Poetry, Conda, etc.
Please be brutally honest. I'm trying to determine whether Rundesk would actually be useful to developers, not just whether the idea sounds cool.