r/learnpython • u/Common_Bell9192 • Sep 09 '26
Principiante
Si empezaran desde cero hoy, ¿qué camino seguirían para desarrollar buenas habilidades como programadores? en estructuras de python
r/learnpython • u/Common_Bell9192 • Sep 09 '26
Si empezaran desde cero hoy, ¿qué camino seguirían para desarrollar buenas habilidades como programadores? en estructuras de python
r/learnpython • u/adjective10111 • Sep 09 '26
I have a Dockerfile in which I use the Python:3.12-trixie. I have docker on my CachyOS PC. I have also a requirements.txt. I wanted to use this image for a container on which I'll use YOLO and try it out. The problem is that my 290GB / partition went from around 70% filled to 95% after a number of rebuilds. I deleted everything docker related but it just went back to 91%.
The reason that I know it is pip's doing, is that when I monitored my disk usage while building the image, and on the `RUN pip install -r requirements.txt --find-links=pypackages` stage it fills up my partition and half way into installation, it fails due to `no more space`. The `pypackages` is just a directory I downloaded some of the packages I have in requirements for less data usage. Also tried `--no-cache` option.
I also went ahead and `du -sh`ed any directory in my / partition and the total didn't add upto the filled storage. I have 165GB mysteriously used and I can't find where that is.
Any help to diagnose further or if you have had similar problems is welcome.
r/learnpython • u/FLANKER_ALFA • Sep 09 '26
Good morning everyone, or whenever you see this. I have a question. I'm starting a personal database project in Python with a user-friendly graphical interface, and I'd appreciate any advice, code snippets, or examples to guide me, especially since I'm still learning the language.
r/learnpython • u/algal12 • Sep 09 '26
Hello, I am looking for some ideas on projects/challenges that I can implement in my classes.
So far we’ve done: Scratch, beginner Python with CLI mini-games, ECDL basics, beginner TryHackMe rooms, and a Linux VM with basic commands. The student is comfortable with variables, loops, lists, simple file operations, and has built a text-based “Zombie Survival” game.
We meet 1 hour/week, so I’m looking for general ideas on what kinds of projects or challenge styles work well at this level (mid-level middle-school, beyond beginner). Anything that’s engaging, slightly game-like, and doesn’t require heavy setup would be great.
If you’ve taught similar students, what types of activities (CTFs, coding games, light forensics, small web projects, etc.) kept them motivated and actually learning?
Any suggestions or directions would be really helpful.
Thank you in advance!
r/learnpython • u/Ok-Scientist-1367 • Sep 09 '26
Need to generate invoices, sales reports, stock reports, and charts in Excel programmatically. Higher officials will audit these. Can't have mistakes.
What's the best approach? Should I use openpyxl to write directly to Excel files? Or is there a better workflow?
Data accuracy is key — pulling from databases/CSV, validating before writing to Excel. How do I prevent data corruption? Invoices need proper headers, borders, currency formatting. Is openpyxl reliable for this or does it break formatting? Can Python generate charts in Excel automatically or do I need to use a separate tool? Should these run daily/weekly and what's the best way to automate execution without manual intervention? How do I track changes if files are auto-generated?
Any libraries better than openpyxl? Xlsxwriter? Pandas to_excel? Looking for production-ready solutions, not prototypes.
r/learnpython • u/chrisjfinlay • Sep 09 '26
I'm writing a script that takes an input from the user, which could be either an int or a string. My current code takes the input, attempts to cast it to an int, and does something based on whether it works or not:
running = True
while running:
search_term = input("Enter search term (Q to quit): ")
try: int(search_term)
except ValueError:
if search_term.lower() != "q":
search_by_name(search_term)
else:
running = False
else:
search_by_int(int(search_term))But there's something about having "successful" code running in the except block that gives me pause for thought. Is this just me overthinking, or is it bad form?
r/learnpython • u/Reasonable-Heron-433 • Sep 09 '26
Hi everyone,
I've taken several Python courses and have a reasonably good understanding of Python itself. I've also worked with things like pandas, NumPy, scikit-learn, etc. in online learning environments.
However, I've realized that I have a major gap in my knowledge: I don't really know how Python development actually works on a local computer.
For example, when working in an online environment, everything is already set up for me. I can simply import a package and start coding. But when I tried working locally with VS Code, I suddenly had to deal with things like:
Installing Python
Using the terminal
Installing packages with pip
Virtual environments
Choosing/configuring the correct Python interpreter
Organizing a project
Saving and reusing dependencies
Running and debugging code
Git and GitHub
Understanding how to share a project with someone else
Understanding what I actually need to install versus what belongs inside my project
I found this surprisingly confusing.
So I'm looking for a free course or tutorial that focuses specifically on this practical development workflow, preferably using Python and VS Code.
I'm not looking for another beginner Python programming course. I already understand Python basics and have used it for data analysis and some machine learning. What I need is something that teaches me how to actually work as a Python developer on my own computer.
Ideally, the course would take me through something like:
create a project → set up Python → create a virtual environment → install packages → write code in VS Code → run/debug it → manage dependencies → use Git/GitHub → share the project
Does a free course like this exist? YouTube courses, documentation, or other resources would also be very welcome.
Thanks!
r/learnpython • u/Jazzlike-Back-235 • Sep 09 '26
so, im a complete starter on a championship where you gotta learn about AI and python, to make an AI later, thats the challenge, but im feeling so left behind, everybody is learning so fast and im stuck, i wanna win this but i dont know python at all, any channel or study path i can follow ? also, in how much study time can i maybe reach a good level ?
r/learnpython • u/Longjumping-Low-4716 • Sep 09 '26
Hi, I’m non cs guy who is trying to get into the python dev, data related jobs and I’m wondering, what are the skills, non listed on the job posts which are required to be the best python developer as a non cs graduate?
r/learnpython • u/imaginer-6126 • Sep 09 '26
I installed VS Code and all. I got to the part where I should download the exercises in a certain part of the course. For me it is part 4. But all I can see is part 1, 2, 3 and 8. What should I do? Thanks in advance.
r/learnpython • u/wingnutticus • Sep 09 '26
I'm completing an assignment for zybook where I have to replace a number from a list and then print the list in reverse. This is my code:
val_list = [18, 12, 15]
new_val = int(input())
val_list[1] = new_val
print(f"List has {len(val_list)} elements:")
for value in reversed(val_list):
print(reversed(val_list), end="<>")
print(end="")It's supposed to just print the reversed list in brackets, but instead it gives me something like this:
<list_reverseiterator object at 0x000001C02CF706D0><><list_reverseiterator object at 0x000001C02CF706D0><><list_reverseiterator object at 0x000001C02CF706D0><>
What does this mean and why is it doing this? Thanks in advance
r/learnpython • u/UltraToxicAsianKid • Sep 09 '26
While configuring AI agent on my local machine made discovery that uv package is 10 to 100x faster than pip, same case for polars. It seems to be everything written in Rust much faster and modern compared to classic python packages. Is it because Rust doesn't require garbage collector, any other reason to that?
r/learnpython • u/Educational_Wash_662 • Sep 08 '26
The title kinda says it all. Looking for a local OCR that can do handwriting and works on Python. Ideally not too heavy. Any ideas? TIA
r/learnpython • u/Substantial-Mix-3990 • Sep 08 '26
Hi all,
Just to give you a bit of background about myself, I’m an accountant with an MSc in Investment and Financial Risk Management and an ACCA qualification. Most of my experience so far has been on the core accounting side, but I’d now like to move towards a role that combines accounting and finance, covering areas such as financial modelling, forecasting, KPI analysis and data analytics, with the longer term aim of moving into more technical areas of finance.
I’m very eager to learn Python and SQL, both to broaden my skill set and to develop skills that are increasingly in demand. I also want to make sure I remain relevant as the profession evolves and, eventually, be able to demonstrate genuine technical ability when applying for more specialised and higher paying roles.
The problem is that I genuinely don’t know where to begin. I’d really appreciate a roadmap or some practical advice, beyond what I can find through ChatGPT and online course recommendations, particularly from anyone who has been in a similar position and successfully made this transition.
I don’t mind putting in the hard work or spending time coding and learning every day. What I’m unsure about is the order in which I should approach it. Should I learn general Python fundamentals first and then move into its applications in finance? Or would it make more sense to start with a finance focused Python course and learn the fundamentals through practical financial applications? And where should SQL fit into that journey?
I’d also be interested to know what sort of projects I should eventually be building to demonstrate these skills to employers, and whether it makes sense to look for roles where I can start using Python, SQL and data analytics regularly while I continue learning.
I’d really appreciate any guidance from people who have taken a similar path.
Many thanks, and apologies if a similar thread already exists. I thought my background and intended career direction might make the question slightly different, so I wanted to provide some context before asking for help.
r/learnpython • u/JoseThelonewolf • Sep 08 '26
I just started to learn python and don't know what I should do first.
Please help me!
r/learnpython • u/Critical-Spite • Sep 08 '26
I am trying to download pandas to be used on an offline machine. The issue is, in order to get packages on the offline, I normally have to use my work computer which has restricted access, so no python on it. My current method has been to download the package from pypy, burn it on a cd, and transfer it over on the offline via --nolink method.
However, I am running into an issue where I can't install due to missing dependencies, again and again.
Is there a way to get the entirety of pandas into a single installable file?
r/learnpython • u/Nutellatoast_2 • Sep 08 '26
Hey everyone,
I'm new to Python and have created my "Rock-Paper-Scissors" game and want to share it on this forum so I can look for ways to improve the code.
The player types in a number between zero and two. These values stand for different moves the player can type. (0 - Rock, 1 - Paper, 2 - Scissors). The computer generates a number between zero and two. The player's input is checked by the main if-elif-else block, as I'm using a nested if-elif-else statement:
import random
player_input = int(input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissor. "))
computer = random.randint(0, 2)
if player_input == 0:
if computer == 0:
print('''You chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
Computer chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
It's a draw!!!''')
elif computer == 1:
print('''You chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
Computer chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
You lost!!!''')
elif computer == 2:
print('''You chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
Computer chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
You won!!!''')
elif player_input == 1:
if computer == 1:
print('''You chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
Computer chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
It's a draw!!!''')
elif computer == 0:
print('''You chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
Computer chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
You won!!!''')
elif computer == 2:
print('''You chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
Computer chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
You lost!!!
''')
elif player_input == 2:
if computer == 2:
print('''You chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
Computer chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
It's a draw!!!''')
elif computer == 1:
print('''You chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
Computer chose:
_______
---' ____)____
______)
_______)
_______)
---.__________)
You won!!! ''')
elif computer == 0:
print('''You chose:
_______
---' ____)____
______)
__________)
(____)
---.__(___)
Computer chose:
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
You lost!!! ''')Any recommendations regarding improvements for the code?
r/learnpython • u/Key-War-9059 • Sep 08 '26
I'm learning from the third edition of Python Crash course by Eric Matthes, and 6 chapters in these lists are growing in size. What's a simple yet effective way I can take notes?
r/learnpython • u/SaThuran • Sep 08 '26
It's the first time I've seen that. So what's the purpose of this exactly? Cause I'm trying to see what I can do in an engine and I only learned about import math today
r/learnpython • u/Dcyph-3r • Sep 08 '26
How do you decide what defines an excessively encoded URL?
I'm working on a personal project to created a URL parser and
detection system and I've hit a wall on how to figure out a way of
categorizing excessivness of query encoding?
Here's what I have so far for the function:
def check_query(analysis: URLAnalysis) -> ScanResult | None:
"""detect excessive encoding entries in URL queries"""
og_query = analysis.query
query = re.finall(r"%\[0-9A-Fa-f\]{2}", og_query)
encoded_count = len(query)r/learnpython • u/Substantial_Belt2626 • Sep 08 '26
Mine: a scraper hitting an API with a strict rate limit. I throttled to one request every fifteen seconds, well inside the documented limit, ran clean for a while, then it just started failing.
Nothing in my code was wrong. There was a daily cap tied to my IP, separate from the per-request limit, and I'd used up the day. I finished the run off my phone hotspot and that was what made it click. Different IP, same code, works instantly.
Days gone. Zero lines changed in the end.
What's yours? Environment, network, permissions, a clock being wrong, whatever. I want the ones where the code was fine the whole time.
r/learnpython • u/loggerhead9 • Sep 08 '26
I am a management consultant a project / team leader level, a lot of the grunt work is being done by analysts in the team; I have to focus on storylining, client relationship management, reviewing the work, etc. As TL / PL have you guys found relevant use cases? I am thinking of creative ways to leverage python and in future use API calls to LLMs to improve automation and make my life more efficient.
r/learnpython • u/Natural-Secretary361 • Sep 08 '26
I am developing devmemory, an engine designed to reconstruct a project’s history by converting Git logs and code ASTs into a navigable knowledge graph. Currently, the system performs search indexing and graph traversal.
I would like suggestions on whether I should store data on disk using SQLite and then process it. Please help me find the best solution.
r/learnpython • u/Ok_Breath_7590 • Sep 08 '26
Started with the dis module disassembled a simple function and saw how Python compiles source into bytecode instructions operating on a stack: LOAD_CONST (push a literal), STORE_FAST (pop and assign to a local var), BINARY_OP (pop two values, apply the operator, push the result). Noticed newer Python versions fuse common opcode pairs (e.g. LOAD_FAST_LOAD_FAST) for speed small but visible evidence of ongoing interpreter optimization work.
Then worked through == vs is confirmed with id() that two lists with identical contents are still separate objects (is → False, == → True), while b = a makes both names point to the same object.
Finished on mutable vs immutable, and specifically why it matters when passing objects into functions. Key realization: calling a function doesn't substitute the argument into the function body it creates an independent local name that starts out pointing at the same object. n += 1 on an int creates a new object and only moves the local name; lst.append(x) mutates the shared object in place, so the caller sees the change too. Proved both cases with id() before/after.
Small, foundational stuff, but building the intuition from scratch with real code has been way more effective than just reading definitions.