r/PythonLearning • u/MEHDII__ • 14h ago
Python Object Model
This is a chart I was preparing for some advanced python object model ideas, including descriptors, and what really are objects in python. I hope somebody can find some use for it.
r/PythonLearning • u/MEHDII__ • 14h ago
This is a chart I was preparing for some advanced python object model ideas, including descriptors, and what really are objects in python. I hope somebody can find some use for it.
r/PythonLearning • u/Handsome_sweettouu • 7h ago
U can watch this interesting python series
r/PythonLearning • u/ProgramBrave718 • 15h ago
In this program I used open trivia api for questions. Everything works fine ..
But , when a user types a letter in the category or amount input (under try block).
The exception is handled by printing "Type an id number" and it gets back at starting
which asks "Enter e or c" instead of going to the input where the wrong datatype was given.
I know a way to handle this (but it is repititive)-
start = input("Enter 'e' or 'c':). lower()
while start not in ('c','e'): print('Please type a valid letter')
start = input("Enter 'e' or 'c':)while start == 'c':
---------------
----------------
start = input("Enter 'e' or 'c':). lower()
while start not in ('c','e'):
print('Please type a valid letter')
start = input("Enter 'e' or 'c':)r/PythonLearning • u/conor-robertson • 1d ago
In June I launched QueryCase, where you learn by working through detective cases instead of watching tutorials. Each case is a short story with a real dataset and a question only your code can answer. It started with SQL, then Excel, and the question I kept getting after that was "can you do this for Python?"
So I built it, and it's now live 😄
Why I think it's worth a look:
What's live in Python:
Machine learning and automation tracks are coming next week! Machine learning takes you from your first decision tree to the kind of fraud model a bank would actually use, and teaches you to test a model honestly so a 90% score means something. Automation is about the jobs that eat an analyst's week, done by code: sorting folders of files, reading and building Excel workbooks, writing reports and emails, and pulling data from APIs and websites.
Your code is real Python running entirely in your browser, so there's nothing to install. Every step is checked as you go, with hints when you're stuck.
It's completely free to start, and you can solve the first case before making an account. I'd really like feedback from people learning Python right now: what's the part that made you want to give up, and does a story help?
Cheers 😄
r/PythonLearning • u/Same-Tree4402 • 1d ago
so we have been assigned some projects this semester, where we have to submit a "digital artifact" for any of the project idea we have chosen. I choose a project that is relevant to some calculations and then displaying them using custom dashboards, for visualizing the calculations. but the thing is that we all have to submit our project in the form of a digital artifact. and I'm confused as to what it exactly means. is it a proper app? or a .exe file? a setup? or just something else entirely. I couldn't really understand what ChatGPT told me about either.
r/PythonLearning • u/RomfordNavy • 1d ago
pathlib.Path appears to run much slower than I expected. The following function deletes .pyc files older than that of the filename passed in as a parameter.
Is there a faster alternative way of doing this?
import time
from pathlib import Path
def stale_pyc_del(path: str) -> None:
spd_start = time.perf_counter()
cur_import = Path(path).resolve()
if Path.is_dir(cur_import):
cutoff_time = float('+inf')
pycache_dir = cur_import / "__pycache__"
else: # file not directory
cur_file = Path(__file__).resolve()
cutoff_time = max(cur_file.stat().st_mtime, cur_import.stat().st_mtime)
pycache_dir = cur_import.parent / "__pycache__"
if pycache_dir.is_dir():
for pyc_file in pycache_dir.glob("*.pyc"):
# print(f"{pyc_file=}, {pyc_file.stat().st_mtime=}, {cutoff_time}")
if path is None or pyc_file.stat().st_mtime < cutoff_time:
print(f"deleting: {pyc_file=}")
pyc_file.unlink()
spd_end = time.perf_counter()
print("stale_pyc_del:", os.path.basename(path), "-", f"{((spd_end - spd_start) * 1000):.3f}", "ms")r/PythonLearning • u/Alive-Cry4139 • 2d ago
I'll start with mine I built a simple chess engine using Python.
r/PythonLearning • u/New_Pay3669 • 1d ago
Recruiters kept asking me the same questions, so I added an "Ask about me" box to my portfolio. The scary part wasn't building it. It was the idea of an AI confidently inventing a job I never had, on my own website.
So the rule was simple: every sentence it says must come from my real résumé facts, and the code checks that before you see the answer.
How it works:
The fun part: personal questions. "Is he married?" or "How old is he?" get a polite refusal, because that's not in the facts and it's nobody's business. People ask those first, every time.
Cost: $0/month. The browser does the search, and Workers AI's free tier covers the rest at portfolio traffic.
What I learned:
- Telling the model "don't hallucinate" does nothing. Checking its output in code does.
- Fewer, better facts beat stuffing the whole résumé into the prompt.
- A refusal that's honest feels more trustworthy than an answer that's smooth.
Happy to answer questions about the citation check or the prompt. And if you've built something similar, how did you handle hallucinations?
r/PythonLearning • u/ProgramBrave718 • 3d ago
In this project i used 5 endpoints and there are 4 functions.
user_info --> Gives the information about the GitHub account (uses 2 endpoints with key name 'user' and 'repos')
repo_detailed_info-->Gives the information about a specific repository like language,forks, files etc. (uses 2 endpoints 'repo_detail' and 'content' )
list repo-->lists all the repositories of a user(requires one endpoint 'repos')
Know_commit_message-->Gives the commit message (uses 'commit' endpoint)
r/PythonLearning • u/Successful_Catch226 • 3d ago
I built a completely free browser-based Python course that goes from print() to building a small GPT
You learn through 116 projects across nine "floors" of a clocktower. Foundations, Fluent Python, Real-World Python, Algorithms, Data Science, ML, Deep Learning and RL. Each project has guided lessons, a buggy program to fix, and your own solution checked by tests. There's spaced review and a placement test if you already know the basics. It's completely free, including certificates.
I'd love feedback from people actually learning:
paulspythoncourse.com
r/PythonLearning • u/HeyMerpy • 2d ago
So I’m new to coding and I’m using Cody.tech (just started 4 days ago) and I thought I his was kinda funny. I typed all that in just for the actual answer to be extremely simple lol
r/PythonLearning • u/PyUnderConstruction • 3d ago
One of the biggest obstacles to learning programming is distraction.
You start learning Python, then jump to Django, AI, cybersecurity, or another programming language. You keep searching for better tutorials and new resources instead of focusing on what you are already learning.
The result? You consume a lot of information but make very little practical progress.
**How to avoid this:**
* Stick to one learning path.
* Focus on understanding the fundamentals.
* Spend more time writing code than watching tutorials.
* Avoid switching between resources unnecessarily.
* Practice consistently, even if progress feels slow.
Remember: You don’t need to know everything. You need to focus long enough to learn something properly.
Consistency beats constant switching.
**Have you experienced this problem while learning programming? How do you deal with distraction and avoid constantly switching between topics and resources?**
r/PythonLearning • u/Melodic_Campaign1444 • 3d ago
rate my project and what should i make next (plz watch in 2X)
r/PythonLearning • u/jake_123_123 • 3d ago
r/PythonLearning • u/Sea-Ad7805 • 4d ago
An exercise to help build the right mental model for Python data.
The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.
r/PythonLearning • u/Business-Feedback635 • 4d ago
setuptools 82 (February 2026) removed pkg_resources. Code that still runs import pkg_resources now fails with:
ModuleNotFoundError: No module named 'pkg_resources'It also fails in any new Python 3.12+ virtual environment, because venv no longer installs setuptools.
I run py-code.org, a search over the code inside PyPI packages. I checked every package that still uses pkg_resources: 1,504 import it with no fallback, so they fail without it. 238 of them had a release in the last six months and have a public repository, so the maintainers are active and can merge a fix.
The fix is usually small, which makes it a good first pull request:
# before
import pkg_resources
requests_version = pkg_resources.get_distribution("requests").version
# after (Python 3.8+)
from importlib.metadata import version
requests_version = version("requests")For data files inside a package, pkg_resources.resource_filename(pkg, path) becomes importlib.resources.files(pkg) / path (Python 3.9+).
How to do it:
pkg_resources, and look at open issues and pull requests.pkg_resources function.python3.12 -m venv), so setuptools isn't there, and run the project's tests.Please send one PR per project, and skip any project where someone has already opened one.
Full write-up, with the replacement table and the most downloaded affected packages: https://py-code.org/blog/pkg-resources-pypi/
r/PythonLearning • u/samoromi • 3d ago
def fib(n):
if n <= 1:
return n
return fib(n - 1) + fib(n - 2)
n = int(input("Количество чисел: "))
for i in range(n):
print(fib(i), end=" ")
r/PythonLearning • u/Chemical_Plum_collab • 4d ago
Hey r/Python! I’ve been building Pocket Editor, a portable code editor and lightweight IDE written in Python 3.9+ and Tkinter.
The goal was to keep the core editor 100% standard library (python3 + tkinter—no Electron, no Chromium wrapper, and zero required pip dependencies just to launch), while letting you plug in full IDE workflows on demand via modular Python plugins.
Core Editor Features:
Ctrl+Shift+P), fuzzy Quick Open (Ctrl+P), atomic saves preserving BOM/newlines, 5-second crash-recovery snapshots, and a dark UI with vertical dockable plugin tabs..py files with register(api) into pocket_editor_plugins/. Plugins communicate through an event/service bus on the GUI thread while delegating heavy tasks to background workers. Includes an in-app Plugin Builder, Plugin Manager, and --safe-mode.ERROR:, WARNING:, compiler file:line: patterns)—no external ANSI library required.Optional IDE Plugins Included:
compile() / json in a worker without executing user code) + Black formatting.clangd LSP autocomplete, clang-format, compiler error underlines, and GDB debugging.tools/php Node folder so it never touches the core).cloudflared HTTPS relay using .team-invite files.r/PythonLearning • u/Advanced_Coyote6049 • 4d ago
r/PythonLearning • u/Beneficial_Camp_8457 • 5d ago
Hey everyone!
I've been thinking about making this post for a while, so here goes.
I'm currently a university student studying Agriculture, with an interest in Biotechnology. A while ago, I got into programming and started learning Python. At first, I was just following tutorials, but eventually I wanted to build actual things instead of constantly watching other people code.
Right now, I'm working on a project called Business Data Analyzer. It's basically a Python project where I'm trying to build a small tool for analyzing business sales data.
So far, I've implemented data loading and processing with Pandas, data quality checks, duplicate and invalid data detection, sales analysis by product and region, visualizations with Matplotlib, and Excel report generation.
I've also been working on making the code cleaner and more maintainable, using Ruff and writing tests with Pytest. Currently, all 41 of my tests are passing, which honestly feels pretty good considering where I started.
I'm still developing the project and there's a lot I'd like to add to it.
One thing I should mention is that I've been using AI tools quite a bit during development. Not just to generate code, but also to understand errors, explore different solutions, review my code, and figure out how to improve the overall project. I think learning how to work alongside AI is becoming an important skill, and I'm trying to get better at that without losing the ability to understand what I'm actually building.
As for where I'm heading, I have a pretty specific long-term goal.
I want to build a solid foundation in Python, move deeper into data analysis and eventually data science, and then use those skills in Bioinformatics.
Since my university studies are related to Biotechnology, the idea of combining programming with biology, genetics, and medical research is something I'm genuinely excited about.
I know it's a long road, and sometimes when I look at everything I still need to learn, it feels a little overwhelming.
I also haven't made any money from programming yet. No freelance income, no paid projects, nothing so far. And honestly, that sometimes makes me wonder whether I'm moving in the right direction or just spending a lot of time on something that might take years to pay off.
But I enjoy doing it, and that's probably the main reason I keep going.
For me, working on a project, fixing something that took hours to understand, or adding a feature that actually works is genuinely fun. It's almost a hobby at this point, but one I'd really like to turn into a career someday.
Of course, university comes first sometimes. During exams or particularly busy weeks, I might not be able to work on my projects as much as I'd like. But outside those periods, I try to stay consistent and keep making progress.
Anyway, the main reason I'm posting here is that I'd love to meet people who are doing something similar.
Maybe you're learning Python, working on data analysis projects, interested in Bioinformatics, or just trying to build things and improve your skills.
It would be really nice to have someone to share progress with, discuss problems, exchange ideas, review each other's projects, or simply talk about what we're learning.
And if you've already been through this journey and have some experience, I'd genuinely love to hear your advice. Especially about getting that first opportunity, making your first money, and avoiding common mistakes along the way.
I'm not looking for anything formal. Just people with similar interests who want to learn and grow together.
If any of this sounds familiar, feel free to leave a comment or send me a message. I'm happy to connect with anyone, whether you're just starting out or have years of experience.
Good luck to everyone working towards something. We're all figuring things out as we go :)
r/PythonLearning
•
u/Low_Ask3080
•
6d ago
Made this Calculator in CustomTkinter after a month of learning
r/PythonLearning • u/AceDrums • 5d ago
Hi Folks,
I've started using python for data analysis at work and I'm very much enjoying it. My goal is to build two apps for myself:
- first, a very basic journaling app (think like Google Keep style)
- Then, when I'm ready, a plant management app.
If I enjoy them enough and think they might help others, then I'd consider putting them on the play or itunes store but not a big concern of mine!
I'd still say I'm entry level but have a lot of experience building and managing databases in Access and SQL, data analysis and reporting in SQL, as well as building solutions in Excel and Access.
For both, I'd like to have an app on my desktop and phone and avoid any extra HTML/CSS/Javascript. I was considering web based but i thought it would be great if I could continue to focus just on python, if possible. The database should be synchronized and stored on the cloud. I was also intending to have push notifications for reminders (e.g., plant watering/fertilizing schedules). I'm aiming to keep it simple and scalable.
Anywho, is there an all-in-one Python framework that handles the UI, backend, libraries, and database well for this, or what is the simplest combo of tools to start with?
I'm very comfortable with SQL if there is a solution that includes that!
Note: I'm fully new to this stuff so assume I know nothing. Also, feedback is welcome for any part of this :)
Thank you!
J
r/PythonLearning • u/TemperatureProper275 • 6d ago
I have built two useful apps for my personal use (basically automation scripts) and I want your feedback:
Coding-Tracker-Dashboard : an autonomous/standalone script that tracks the time when coding on specified coding enviroment.
Downloads-Folder-Organizer : a script that organizes the files in a specified target folder.