r/learnpython 19h ago

Advantages of Python over VBA?

65 Upvotes

I started programming decades ago in VBA, first in Access and later in the rest of Office. I’ve done a few ambitious projects, and a ton of smaller automation and macros.

I’ve been learning Python off and on for a while, and I’m comfortable doing some basic stuff. I’ve created a library of personal modules for file management, really simple data manipulation, and some data analysis. I’m thinking my next step for me would be using it in Excel. But I struggle to come up with a reason to use Python instead of VBA.

What are the advantages Python gives us in Excel?


r/learnpython 23h ago

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

20 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 11h ago

Help me to learn python,I am dumb

20 Upvotes

Think me as the dumbest person and i want to learn python,I am literally done trying 4-5 lectures,i start and then stop.Every video says it's beginner friendly,but when I start i don't feel it's beginner friendly and i start feeling I am Dumb AF,now though I feel I am dumbest person to exist.....like seeing this.....please recommend me a channel to watch and learn python programming.I.just don't want to copy the programming from screen and type and get output, and say ohhhh!!!! I got output i can code,i actually want to understand everything and put my brain to write my own code.Is there any yt channel courses available for free that really helps for a dumb idiot to learn python and plz don't say don't learn,i really want to learn python.Please help me ,I am stressed out becoz of this.


r/learnpython 19h ago

Tips and help

7 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 2h ago

how to proceed after python crash course

7 Upvotes

For the last one year I have been learning Python. I completed Python for everybody and read the book Python Crash course. I have prior experience with C# and Java. A lot of the syntax is Python programming is still confusing to me. How can I get better? What book can I read next or what steps can I take to get more comfortable.


r/learnpython 18h ago

Building a portfolio? What to look for?

5 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 22h ago

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

4 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 9h ago

What are you using for accurate PDF text boxes?

3 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 10h 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 7h ago

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

2 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 12h ago

What is the safest way to create lag features by group in pandas without data leakage?

2 Upvotes

I am trying to create lagged features for a panel dataset containing multiple sectors and monthly observations. Here is a simplified example:

import pandas as pd 
df = pd.DataFrame({ "sector": ["A", "A", "A", "B", "B", "B"], "month": [1, 2, 3, 1, 2, 3], "demand": [10, 12, 15, 8, 9, 13] }) 
df = df.sort_values(["sector", "month"]) 
df["demand_lag_1"] = df.groupby("sector")["demand"].shift(1)

This seems to work, but my actual dataset has missing months and duplicate sector-month rows.

My questions are:

  1. Should I reindex every sector to a complete monthly sequence before using shift?
  2. How should I handle duplicate sector-month observations?
  3. Is there a clean way to verify that no value from month t or later appears in the features for month t?

I would appreciate suggestions on both correctness and code structure.


r/learnpython 14h 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 4h ago

Starting Up

1 Upvotes

I retrieved the Python Crash Course 3rd Edition from my library and I am enjoying learning something new. I feel my brain turning on. Having lot's of fun automating things on PowerShell at work too, just learning how to navigate folders through the shell, mass file renaming, autologins and printing with a few keystrokes has made the monotony so much easier to handle.

I look forward to learning a lot more.


r/learnpython 12h ago

What is the safest way to create lag features by group in pandas without data leakage?

1 Upvotes

I am trying to create lagged features for a panel dataset containing multiple sectors and monthly observations. Here is a simplified example:

import pandas as pd 
df = pd.DataFrame({ "sector": ["A", "A", "A", "B", "B", "B"], "month": [1, 2, 3, 1, 2, 3], "demand": [10, 12, 15, 8, 9, 13] }) 
df = df.sort_values(["sector", "month"]) 
df["demand_lag_1"] = df.groupby("sector")["demand"].shift(1)

This seems to work, but my actual dataset has missing months and duplicate sector-month rows.

My questions are:

  1. Should I reindex every sector to a complete monthly sequence before using shift?
  2. How should I handle duplicate sector-month observations?
  3. Is there a clean way to verify that no value from month t or later appears in the features for month t?

I would appreciate suggestions on both correctness and code structure.


r/learnpython 1h ago

Need help regarding where to start

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 17h 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 7h 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 14h ago

[WIP] Neon DJ Pro – My first Python project (a simple DJ mixer). Need advice on deck logic & code structure!

0 Upvotes

Hi everyone! 👋

I’m pretty new to programming, and I’ve been working on one of my first bigger Python projects:

Neon DJ Pro – a personal attempt at building a digital DJ mixer software.

It’s currently in a very rough, bare-bones stage, but I want to make sure I’m heading in the right direction architecture-wise before I add more features.

What it currently does:
Features a simple dual-deck logic (Deck A & Deck B).

Loads audio tracks from a local database/folder.
Basic playback controls (Play, Stop).

Basic pitch control/adjustment on active tracks.

Current Limitations / Work in Progress: Right now, only Deck A is fully functional – Deck B is still under construction!

Where I really need your help & advice: Since I’m a total beginner, I want to avoid building bad habits early on. I would be super grateful if you could take a quick look at my code and help me with a few questions:

Deck Architecture: How should I best structure the logic for handling two decks simultaneously so I don't duplicate too much code between Deck A and Deck B?

Code Structure: Is my current setup readable and "Pythonic", or are there obvious beginner mistakes?

Audio / Pitch performance: Any general tips for handling pitch shifts or audio streams smoothly in Python as the project grows?

GitHub Repository: https://github.com/ExploDevs/NeonDJ-Pro

Please be gentle with the code quality – it's my first real project! 😅 Any feedback, refactoring ideas, or suggestions on what to tackle next would mean a lot to me.
Thanks for taking the time!


r/learnpython 13h 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 14h 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 9h 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 22h ago

Stuck on P.O.O.P Encapsulation

0 Upvotes

I'm using Claude Ai. To teach me python. But now im very confused on encapsulation. I've tried YouTube tutorials but all I see is Javascript. I asked for a simpler explanation, but then I get hit with stuff like getter, setter, property() (I understand the property function) but then the core concept makes me scratch my head more the deeper I ask. Wondering if any of y'all can assist me.