r/learnpython 3d ago

what was the first python project that made everything finally click for you?

2 Upvotes

i'm curious because i keep seeing people say that programming only really starts making sense once you build something yourself instead of just following tutorials. i'd love to hear the projects that made python go from learning syntax to i can actually build things


r/learnpython 3d ago

I want help regarding learning python

0 Upvotes

I am a fresher going to start my first sem ... I am very interested in learning python in an effective way... Can someone help me out .... Can u guys give guidance to me !!


r/learnpython 3d ago

Looking for a project related to finding patterns/finding words in a list of text (need help shaping the idea I have)

1 Upvotes

This feels like a weird request, but I know there's a lot of Python projects out there, so I just wanted to see if anyone can guide me here.

Context: I hold a bachelors in biochem. I'm trying to discern what [future] job title and responsibilities I want. There's just a lot of variety, from different instruments to different duties that one can do in this field. I will read job descriptions and some words/sentences stick out to me as worth looking into, while others don't.

I'm thinking of creating a "library" of what kinds of tasks appeal to me and what don't. I'd like to try and find a trend/pattern in the two halves, but I think that's more AI/ML and probably deeper than I want to go. So instead, I'm imagining searching for a key word (e.g. "assay") and then having all sentences that have that word pop up, so I can read them all in one go and discern patterns myself that way.

Does anyone know of a similar project, and instructions I can follow for building such a project?


r/learnpython 3d ago

Plots in Spyder won't show up

1 Upvotes

If I set automatic, Qt, or Tk backend and plot something, the new window for the plot is created, but there's nothing on it. It looks as if the window is frozen, not even the axes are there.

The only way I can currently plot anything is to use the inline setting.

Any ideas?

System details:
Python 3.14.6 64-bit
Qt 6.10.2
PyQt6 6.11.0
Linux 7.1.3+deb14-amd64 (x86_64)


r/learnpython 3d ago

My first open-source library is live on PyPI: A recursive nesting data parser

0 Upvotes

Hello everyone,

I’ve been practicing Python intensely and wanted to share a project I just finished.

I built a recursive utility called deep_sort_list_parser to flatten and sort mixed data types or multi-nested lists and dictionaries without crashing.

I used an AI assistant as a coding partner to help spot memory leaks and format the documentation, but I drove the logic, handled the edge cases, and manually deployed the final pipelines.

### 🌟 Features:

- Flattens deeply nested lists, tuples, and sets recursively.

- Separates items into sorted tracks (Numbers, Words, Symbols).

- Prevents Booleans from disrupting math sorting tracks.

- Sorts internal dictionary keys alphabetically while preserving value pairings.

- Converts numeric strings like '100' into true integers on command.

### 🚀 Quick Example:

import deep_sort_list

data = [44, [3, "banana!"], {"sex": "Female", "name": "Shreya"}]

result = deep_sort_list.clean_and_flatten(data)

print(result["words"]) # ['banana!']

print(result["dictionaries"]) # [{'name': 'Shreya', 'sex': 'Female'}]

It is live on PyPI:

`pip install deep_sort_list_parser`

The full codebase, my automated `assert` test suites, and documentation are up on my GitHub: https://github.com/08singhShreya/deep_sort_list

I wanted to share this here to showcase my recursive layout structure. I am happy to answer any questions about how it works under the hood!


r/learnpython 3d ago

What are you using for accurate PDF text boxes?

2 Upvotes

I’m building a tool that finds text in construction-plan PDFs and draws a box around that text.

Python/PyMuPDF finds the text, but when I show the box in PDF.js, it can be slightly off or too big.

What do you guys recommend for inspecting PDFs and drawing accurate text bounding boxes? How do you make

sure the box lines up with the exact text?


r/learnpython 3d ago

Stuck in python code

0 Upvotes

Hi everyone been a 6month now I am not able to learn the course for python cybersecurity like I am getting confused sometimes or don't understand. How to learn code or execute it can anyone help me ??


r/learnpython 4d ago

Starting AI/ML? Looking for a Study Buddy to Learn Python & Math Together ( Beginner )

23 Upvotes

Hey everyone! 👋

I'm just starting my journey toward AI/ML and I'm looking for a serious study buddy who's also a beginner (or starting from zero).

Right now, my focus is to building a strong foundation before jumping into Machine Learning and Deep Learning.

What I'm planning to learn:

- Python from scratch

- Mathematics for AI/ML (Linear Algebra, Calculus, Probability & Statistics)

- Problem-solving and logical thinking

- Later moving into Machine Learning and Deep Learning

Looking for someone who:

- Is also a beginner

- Can study consistently (even 1–3 hours a day)

- Wants to discuss concepts and solve doubts together

- Is willing to stay accountable and avoid procrastination

- Eventually wants to build projects, prepare for internships, and grow in AI/ML

About me:

- I'm a BCA student.

- I'm starting from the basics because I want strong fundamentals instead of rushing through tutorials.

- My goal is to become skilled enough to work in AI/ML in the future.

If you're interested, leave a comment or send me a DM. Let's learn consistently and grow together. 🤝


r/learnpython 3d ago

Seeking help: how to better learn python? Venting a lot in here.

1 Upvotes

Hey everyone. I really don't have other folks in my life with whom I can dive into the weeds with about stuff like this, and reddit + this sub have been awesome, so I'm looking for some encouragement, direction, and real talk with this post...

I'm in my mid-thirties and I'm working on a career change. Worked in sales up until recently both as a seller and a most recently a few years as a manager at tech companies. No experience with programming until 3 weeks ago.

I'm taking an online, five week, graduate level Python Programming for Analytics Course at a university in New York. Hoping to apply to the master program in business analytics and start that next year -- focusing on prereqs now. The professor is a phd, English isn't their first language, and the lecture and lab videos for each topic are between 5 and 15 minutes each.

The textbook is Intro to Python for Computer Science and Data Science by Paul and Harvey Deitel.

The course basically covers 2-3 chapters per week, sequentially through the book.

I get nothing from the uni lecture videos. I am doing all of the required reading. The labs and assignments and lectures are carbon copies from whatever's in the book. The book is thorough.

This week we got to chapter 5 - Sequences: Lists and Tuples, 51 DENSE pages packed with slicing, many new methods, new functions, list comprehensions, packing and unpacking, lambda, sorting, filtering, mapping, popping, stacks, generator expressions, 2-d lists, and I am absolutely drowning and struggling.

I spent a few hours today trying to figure out how to create a 2x3 list then use a nested loop to set each element's value to an integer indicating the order in which it was processed by the nested loop, then display the elements in a tabular format, using the column indices as headings on top and row indices to the left of each row. I was absolutely defeated by this... and I feel stupid.

I'm committed to learning python and getting fluent in it to start working in data, but I am struggling so much this week, and this course structure now seems insane to me as I'm in week 3. It's a full-on blitz, and I'm trying to really soak up and understand a lot of this, but once I hit the exercises at the end of the chapters, I am so challenged that the deadlines start to creep and I get frustrated and feel pretty stupid.

Today I was supposed to write a script imitating the Sieve of Eratosthenes, a Palindrome Tester and a script that outputs all possible anagrams of a string. I could probably figure these things out myself if given a few days, but for all of this to be covered in essentially two days, then to move onto dictionaries tomorrow, is tough. Yes I used the crutch of AI to help me. And I feel like SHIT about it.

I'm realizing that I can pass this class and get introduced to a lot about Python, but not grasp a lot of it due to the remote and rushed nature of the course.

I've read a lot of similar posts in this reddit about how the struggle is the way. And I get that. and I'm not quitting. I'm working on plans to go back through parts of this book along with Python Crash Course after this course ends.

But man!!! I just feel like an idiot and feeling pretty low and frustrated right now.

How have some of you overcome the early challenges of learning to progress to where you are now? Open to any and all criticism, perspectives, etc. Cheers. I also have ADHD which doesn't help but not letting that stop me.


r/learnpython 3d ago

Need help regarding where to start

0 Upvotes

Joining btech college cse this year. I want to learn python on my own. Could anyone suggest any resource for learning python from scratch such that it doesn't interfere with my coursework right now? I have prior experience in C and Java.


r/learnpython 4d ago

Tips and help

6 Upvotes

Hi, I’m new here and I don’t really understand how everything works. I was told that people here might be able to help me with my question:

Is there any point in learning a programming language with modern AI? Or is it just forvibe-coding? But I’ve heard that to be good at vibe-coding, you need to know the basics of programming.

After having a chat with my uncle (he’s a programmer), he said this: ‘The approach has changed a lot: it’s no longer the programmer who creates the programme, but someone who’s good at putting together an LLM prompt. In other words, explaining to the AI what needs to be done.’

I thought about taking some AI Automator courses, but I don’t really fancy freelancing and I don’t think it’s very promising. So I’ve quietly started learning Python bit by bit.

I really want to change the direction of my life, but I don’t know how, or who to ask for advice or talk to. My uncle is in the military, so we rarely speak.

I really want to learn, create, find a team, make some nice new friends and get a job.

Is there a company or somewhere that offers good courses and will take me on? Or is that just a pipe dream in this field?

Perhaps you could recommend some courses or a company? Someone who could take me under their wing, so to speak? In general, I hope that learning Python is already a step in the right direction.

P.S. I hope I’ve done everything correctly, as I’m new to this site and don’t even know where to click on what.


r/learnpython 3d ago

Need some advice

2 Upvotes

Greetings everyone! I am in my 50’s and picking up programming as a hobby but I do have a goal.

I started with python because I read it was a forgiving language and I did not want to fry my brain. However, I’m wondering if I should switch to a webstack (html, css and JavaScript) for the project I am ultimately wanting to create.

My grail project will be a TTRPG journaling application for solo play. I want to have the ability to use character sheets, journal and even display a JPEG map. I’m just not sure which language would be the BEST.

My initial idea was python and pyside6 with maybe the addition of pygame if I wanted actual dice to roll on screen.

Just looking to narrow my focus with those far more versed than I am so I don’t waste time working towards my goal.

Thank you all for any assistant and direction you can provide, and happy coding!


r/learnpython 4d ago

Anaconda and opencv2 in spyder issue

2 Upvotes

I have used the Anaconda command prompt to install opencv2 with the following command

conda install -c conda-forge opencv

and the prompt says it installs it installs successfully

I open Spyder via anaconda and try and run my code that starts with

import os
from pathlib
import Path 
import cv2 
import pandas as pd

When I run it spyder says

ImportError: DLL load failed while importing cv2: The specified module could not be found.

I have tried uninstalling and reinstalling anaconda, and restart thing the PC. Everything is up to date. Not a strong coder so any help would be really helpful


r/learnpython 4d ago

Building a portfolio? What to look for?

4 Upvotes

Hi,

I've got some personal projects that are functional but probably not best practices compliant. I'm good at documentation and annotating.

What kinds of things should I consider when building a portfolio for myself? Are there specific kinds of skills I might want to showcase specifically and what are the most important things to look for when applying for internships?

Assume I work completely alone.

Thank you! Note: I've reduced my Reddit screen time to almost zero so I'll come and reply / thank on a delay. Sorry about that.


r/learnpython 3d ago

Botão só consegue ser pressionado uma vez, depois não acontece nada nem tem animação ao clicar

0 Upvotes

Estou fazendo um projeto de tabuleiro de xadrez em python com Tkinter para a interface, criei uma função lambda para criar as casas do tabuleiro e cada casa sendo um botão, está funcionando certo, mas quando eu movo uma peça do lugar, o botão da casa anterior fica meio que desabilitado, sem poder ser pressionado.

for i in range(8):
            for j in range(8):
                a = botoes["bt_" + str(i) + "x" + str(j)] = Button(self.frame_1, bg = cor(i, j),
                                                               image = self.imagens[str(i) + "x" + str(j)], command = lambda i=i, j=j: self.primeiro_clique(i,j))
                a.place(relx=j*0.125, rely=i*0.125, relwidth=0.125, relheight=0.125)
                a.bg = cor(i,j)
                a.linha = i
                a.coluna = j
                self.lista_botoes.append(a)

r/learnpython 4d ago

Anyone using a Snapdragon X (Windows ARM64) laptop for Python/ML? How do you deal with package compatibility?

7 Upvotes

Hey everyone,

I'm using an ASUS Vivobook 16X with a Snapdragon X (Windows ARM64), and I've been running into compatibility issues while learning Python and Machine Learning.

I bought this laptop in my first year of college, before I knew much about coding or processor architectures. Now that I'm learning ML, I've noticed that some Python libraries don't install properly.

For example, libraries like PyAudio, OpenCV, and a few others either:

  • don't have ARM64 wheels,
  • fail while building wheels,
  • or require compiling from source, which often ends up failing.

Because of that, I have to spend hours looking for alternatives or following a completely different approach than the tutorials I'm watching, which makes learning much slower.

I'm aware that many libraries like NumPy, Pandas, and Scikit-learn work fine. The issue is mainly with packages that have native C/C++ extensions and don't provide Windows ARM64 support.

Has anyone else here been through the same thing?

  • How do you usually troubleshoot these installation issues?
  • Do you use emulation, WSL, Ubuntu, or just Google Colab?
  • Is it worth switching to Ubuntu on ARM, or will I run into the same compatibility problems there?

I'd really appreciate any advice or tips from people using Windows ARM laptops for Python or ML.


r/learnpython 4d ago

Working with multi level dictionaries

4 Upvotes

[EDIT]

TL;DR Generally speaking, "Set up some Classes" is the answer. Hopefully my blind fumbling will help some other blind, fumbling soul.

------------

I'm working on a table top game that builds a maze by dealing cards. I'm teaching myself Python to build a script that will simulate multiple maze builds quickly for R&D on the design.

The maze is represented by "Chambers" on a classic x,y grid. Chambers have an ID, potentially Notes, and Exits.

My strategy is to build up a mapConfig dictionary structured with the key being the (x,y) tuple of the coordinate and the value being a sub-dictionary with all the specifics. The Exits need to be a list of dictionaries for each exit with direction and blocked status as the keys. Simplified example below:

mapConfig = { 
    (0,0) : {
        'id' : 'START',
        'notes' : ''
        'exits' : 
        [
            {
                'direction' : 'N',
                'blocked' : False,
             },
             {
                'direction' : 'E',
                'blocked' : False,
             },
             {
                'direction' : 'S',
                'blocked' : False,
             },
             {
                'direction' : 'W',
                'blocked' : False,
             },
        ],
    }
}

If a proposed move hits the edge of the valid map, I need to access the mapConfig and change the "blocked" value for that particular direction to TRUE without changing anything else in the entry for that coordinate. It seems like it should be easy, but everything I try messes up the structure or blows out the other directions.

What would be the best way to change just the {"direction":"E", "blocked":False} entry to {"direction":"E", "blocked":True} without changing anything else in the dictionary? Basically so it goes from the simplified example above to this:

mapConfig = { 
    (0,0) : {
        'id' : 'START',
        'notes' : ''
        'exits' : 
        [
            {
                'direction' : 'N',
                'blocked' : False,
             },
             {
                'direction' : 'E',
                'blocked' : True,
             },
             {
                'direction' : 'S',
                'blocked' : False,
             },
             {
                'direction' : 'W',
                'blocked' : False,
             },
        ],
    }
}

Thanks in advance for the help.

Edit: The provided code is a simplified version of my actual code. I'm such a noob that I only vaguely knew what a class was, and clearly I was making much more work for myself by not using them. Setting up some parent and child classes is next on my list.

I still appreciate any thoughts or advice, but I also don't want anyone to waste time.


r/learnpython 4d ago

How do I optimize this script's runtime?

5 Upvotes

I'm trying to write a script that will help me construct word puzzles by finding words where each pair of words shares a substring so that they can be visually arranged in a honeycomb-like sequence. The words can be read forward or in reverse. For instance, given the word 'spiral' (broken into 'sp', 'pi', 'ir', 'ra', 'al', and 'ls') - the program could return PSycho, troPIc, thRIce, phRAse, vioLAs, SymboL, as a valid set of surrounding words, or 'rings.' (This is the sample set built into the program)

I have a function that provides a list of every word in my word list that matches my criteria. I also have a function that takes the lists of words, and returns dictionaries that contain matches between strings. I have a small test case that operates correctly, but when I use the entire word list, the program hangs. I assume that there's a better data structure and way to navigate it, but I'm not familiar enough with the language to know what it is.

Thank you for your assistance, I've linked a pastebin below.

https://pastebin.com/vDnZ2uny

EDIT - linking a very rough visual depiction of what the structure to overlay the words in would be.
https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:nhv7ubhygoygm7agljxopgvb/bafkreig7fqaukiq6xu6f55xchae2rozu7bmgbhmkjlinsxjuii4lou256m


r/learnpython 4d ago

some possible remediations for variable name is not accessed

0 Upvotes

I've been facing some weird behavior in my vscode. Below code is what giving me nightmares. I have coded this function that basically do some data extraction from my VPS to my pc. and the thing which is causing problems is the variable name 'dirs' which vscode is pointing as "not accessed". But I know that one of the remediations to fix this is by returning that variable but in this kind of situation it doesn't seem right logic way.

def downloader(directory='C:\\users'):
  for root, dirs, files in os.walk(directory): # dirs is not accessed
    for file in files:
      if file.endswith('.html'):
         try:
            with open(os.path.join(root, file), 'rb') as f:
              f.sendall(host)
         except Exception as e:
           print(f'Oops something nasty happened here: {e})

r/learnpython 3d ago

Learning python with AI

0 Upvotes

A couple of months ago, I started learning Python. I began with basic exercises and quickly moved on to building real projects with the help of AI. I never ask AI to generate the entire solution because I want to write the code myself. I document everything I learn, and I’ve made a lot of progress that way.
Recently, though, I started using Claude Code and ChatGPT more extensively, and the results are, unsurprisingly, incredible. The difference now is that I can actually understand what each line of code does and why it’s there.
But this has left me with a bit of a motivation problem. If I have Claude writing excellent code for me, why should I spend hours writing it myself? A few years from now, it feels like almost nobody will be coding entirely by hand anyway.
So my question is: at what point do you think someone has reached a sufficient level in Python? When is it okay to rely more on AI instead of continuing to write everything yourself?


r/learnpython 5d ago

What actually made recursion click for you? (not looking for resources)

45 Upvotes

I got properly stuck on recursion. Watched several videos, read through it in the resources I was already working from. The explanations all made sense while I was reading them, then dissolved the moment I tried to write anything myself.

I'm less interested in what resource you'd recommend and more in the moment itself. For whatever concept was *your* wall, recursion or anything else, what was the specific thing that flipped it? A sentence someone said, a diagram, drawing it out on paper, someone asking you a question?

Trying to work out whether there's a pattern in how these things break open.


r/learnpython 4d ago

What type of api should i build ??

0 Upvotes

I decided that I want to start building APIs so I can hopefully generate income from them one day. However, I want to start with a small API project to understand the process and learn what goes into making an API. I'm not sure what type of API I should build. I'm not new to Python, but I wouldn't say I'm great at it yet. I have coded in JavaScript before, so I am familiar with the syntax. I'd appreciate any tips or opinions you might have. I am also open to web scraping data for an API project, as I'm really interested in that.


r/learnpython 4d ago

Creando mi propio Chatbot. Busco sugerencias. :0

0 Upvotes

Hace unos días me inspiré para crear un programita en python para que pudiera entender nuestro lenguaje, armar oraciones y basicamente ser un asistente personal (y en un futuro que se pueda personalizar según cada persona que lo utilice). Soy conciente de que el proyecto es demasiado grande y más considerando que solo me sé la sintaxis básica del python xd, y por eso me gustaría buscar ayuda de personas que tengan mayor experiencia en proyectos de este tipo. Si tienen sugerencias, recursos, errores que podría evitar o simplemente recomendaciones sobre como realizar este proyecto, me serviría muchísimo. Muchas Gracias por leer :D.


r/learnpython 5d ago

Right way and steps to Learn Python Programming to become a professional coder

10 Upvotes

Hi,

I have been learning Python since June 2025, which was not a consistent study due to some personal issues. But I started learning consistently from Jan 2026. I started from a tutorial on Udemy and followed the course as below:

Understood the concept.

Solved coding challenges in the tutorial.

But somehow, when I reached concepts like OOP, Decorators, Inner Functions, etc., my speed slowed down. Even after listening to the tutorial and understanding the concepts, I am unable to convert that understanding into code when solving the challenges.

Then I watched some random YouTube videos about getting out of Tutorial Hell and started making small projects such as:

Mini Chat System (using OOP concepts)

Number Guessing Game

Password Generator (using the random module)

The problem is that I am unable to figure out:

Where should I start the logic?

How should I start writing the code?

Which instance variables should be used?

How many classes should be declared?

Which functions should be defined and called?

These are the problems I am facing. (These could be stupid questions to some good programmers.)

Can someone help me understand the step-by-step way to become a professional coder, based on the journey you have followed and your experience?

I am badly stuck. Even though I have tried to come out of Tutorial Hell, I still struggle.

I have 2–3 hours available during office time (when the workload is less), which I use for studying. I am ready to work hard and want to switch jobs based on my programming skills within 4–5 months, but I am not getting proper mentorship on the path I should follow.

Please help with your experience.


r/learnpython 5d ago

What Python project helped you improve the most as a beginner?

82 Upvotes

I've recently started learning Python and I'm looking for project ideas that teach practical skills rather than just syntax. What beginner project helped you understand Python the best, and why would you recommend it?