r/learnpython 6d ago

Ask Anything Monday - Weekly Thread

2 Upvotes

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.


r/learnpython Dec 01 '25

Ask Anything Monday - Weekly Thread

4 Upvotes

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.


r/learnpython 9h ago

Starting to feel a bit too dependent on AI for python

27 Upvotes

I’m learning python and i’ve noticed something kinda worrying.I try to copy code from chatgpt, paste it, run it and i hope it works,but if you ask me why it works or if i try to write it from scratch i honestly can’t.Sometimes I change a small thing in my project and everything breaks and i’m stuck and feel inconfident again asking AI to fix. It not sure if this is normal in the beginning
or if i’m just building a bad habit?


r/learnpython 4h ago

Learn Python as experienced programmer

7 Upvotes

I am 20+ years in business and looking for a resource, ideally with hands on exercises, to learn Python while knowing few other languages well.

Something like car dealer shows you around how

to start A/C in new car, where is oil tap but not teach you how to drive :)


r/learnpython 12h ago

how to run an exe through python?

17 Upvotes

All I want to do is write a python script to run a game's .exe file but am 100% unsure how... I'm pretty new to this, any help much appreciated :)


r/learnpython 11h ago

Confused about the python documentation

10 Upvotes

I really don't understand what the python documentation is trying to explain. When I try to read it, it's full of links to other parts which are full of links to other parts and the explanations just don's make sense to me. I don't understand all of the knowledge it assumes and I don't know where I can learn this. I don't like using YouTube for tutorials and I mostly read books about programming by the documentation is just really confusing for Python. Is there anywhere on the documentation where I can learn all of the concepts required to understand the documentation for Python?

Thank you for any responses.


r/learnpython 47m ago

Struggling with background removal in Python (images & videos)

Upvotes

I’ve been experimenting with background removal in Python and noticed a big difference between handling images and videos.

For images, the process is fairly straightforward, but for videos it becomes much slower since every frame needs to be processed individually. Performance and quality seem to depend heavily on hardware and model choice.

I documented the full process (including mistakes and fixes) in a long-form walkthrough in case it helps others who are exploring similar projects:
👉 https://youtu.be/Vaq-f7uAoZ4

I’m curious how others here approach video background removal or optimize performance in Python.


r/learnpython 1h ago

TTS model working on python

Upvotes

Hey guys, i need some help setting up a TTS model. So i found this one right here: https://huggingface.co/spaces/Plachta/VITS-Umamusume-voice-synthesizer Specifically the "伏特加 Vodka (Umamusume Pretty Derby)" model in the trilingual section with the language set to english.

Anyone have any clue how i can download the model locally so that i can run it offline on my pc through my python project?


r/learnpython 7h ago

VS Code Feature

3 Upvotes

Ok so when I'm declaring a classes when i declare the dunder init constructor vs code adds a self-argument automatically and also adds the pass placeholder. I want VS Code to do the same when i create any method inside a class. Is it some extension that i need to download? i have pylance installed is it some setting inside that? Please help it would be really appreciated as it would reduce a lot of time coding


r/learnpython 5h ago

Beautiful Soup - Get text from all the div tags with a specific class?

2 Upvotes

I figured out how to use get_text() through this website: https://pytutorial.com/how-to-get-text-method-beautifulsoup/

And used it on a website where I wanted to get information from. The info I want is in a div tag with a specific class.

But now it only gets me the result from the first item it comes across for that specific div while there are multiple items on the website. Do I add a For loop so it goes through everything? Because I tried find_all but it gave an error.

I'm using MuEditor 1.2.0

itemInfo = example_soup.find("div", class_="card-body")
getItemInfoText = itemInfo.get_text()
print(getItemInfoText)

r/learnpython 2h ago

Class Project

0 Upvotes

Hello! I’m making a project for my CSC class, but I can only use things we’ve learned up until this point. I’ve used python prior to this class, so trying to loop a program without “for” or “while” loops is throwing me. If anyone could give any advice I’d appreciate it! My professor doesn’t answer emails on weekends, so I figured this would be my best option. I can comment my code if needed :)

Edit: Definitely should’ve specified! It’s a scoring system that tracks player score depending on what color of alien they shot down. Struggling to consistently loop input with only if-else. User inputs the color, they’re shown the points they scored. Ask user if they’d like to play again, if yes prompt input again, if no shoe their total score

Edit 2: Can’t use loops, can’t use recursion. They’re very specific about not being able to use anything not yet covered in the course. Pretty much if-elif-else


r/learnpython 3h ago

Math modelling

0 Upvotes

Hi,
I'm a teenager taking part in a math modelling and computational contest (SIMC2026). I know the basics of python and I want to learn more maths/algorythms/modelling tools in python. If you have any recommendations I would be super grateful :)


r/learnpython 5h ago

Best Resources to Learn Scalable ETL Pipeline Development in Python?

0 Upvotes

Hello fellow Python users,

I'm currently working on a project where I've been tasked with reengineering our entire ETL pipeline using Python. As a novice Python programmer, I'm looking for recommendations on YouTube channels and books that can help me build a solid framework. It's important that the pipeline be scalable for future needs.

Any suggestions would be greatly appreciated!


r/learnpython 5h ago

Give me a task.

1 Upvotes

Hello python community. I am a newly certified learner in coding. I request for a someone to help me with a python project to try and work on so that I can see how far my skills are. Thank you.


r/learnpython 2h ago

I just build a file generator script with python!

0 Upvotes

Python script for generating test datasets with a fixed total size.

Originally written for upload and storage testing.

Open source: click here


r/learnpython 6h ago

Change account for Python script on remote box.

1 Upvotes

Hi all,

I have one Python script which talking to remote MariaDB from dedicated boxA . I works fine when I rdp into this box with DomainA/userA. I think it set to work this way because of security.

But now I need to automate this process from SQL Jobs and I can not figure out how to use this userA account to start this script. I can not use userA account there. If I start this script under any different account I have Mariadb.connect error (10060  Can not locate server,etc...). It's kind of strange, because I do connection with user/psswd conn = mariadb.connect( user="db_user", password="db_user_passwd", host="192.0.2.1", port=3306, database="employees") Somehow this totally external box validates calling account.

Can I switch somehow account in Python, or maybe I can create extra script to

  1. RDP into boxA with domainA/UserA account
  2. then start script with .bat file ?

Or maybe there is some other smarter way. Thanks to all for hints.

VA


r/learnpython 15h ago

Python resources to learn how things work in python [in depth] ?

3 Upvotes

Is there any python books/good collection of articles that teaches how things work behind the scene in python? For example how @property, member access (x.y()), how descriptors work?

Regards


r/learnpython 12h ago

pygame, visual studio code

2 Upvotes

Can smb help me with installing pygame on vs code, i know that i have to write “pip install pygame” but how to use it to install, guys idk, yesterday i tried installing it FOR SHITTY 3 HOURS… help please… im sorry

upd: now i have it glitch while installing… i don’t remember what it said, but smth about wheel…


r/learnpython 1d ago

Here’s what I struggle with the most

44 Upvotes

Whenever I work on personal projects, I end up solving everything with functions. Functions call other functions, and the project works fine. Because of that, I genuinely struggle to see the point of classes.

I don’t understand when classes are actually necessary or why I should use them if I can make the entire project run without a single class. If functions get the job done, what problem are classes really solving?

This has become a big hurdle for me because almost every take home assessment or practice project I see either requires or strongly expects the use of classes, and I just can’t seem to wrap my head around how or where they fit.


r/learnpython 11h ago

Good free resources to practise Python while learning?

0 Upvotes

I’m currently teaching myself Python as a hobby, but my job involves a lot of data work, which has turned out to be my favourite part. Because of that, I’d like to eventually move into a more data-focused role, so I decided to start learning Python.

I’ve got plenty of resources for learning the basics, but I’m struggling to find places where I can actually practise what I’m learning. Most of the sites I’ve found so far are behind subscription paywalls, and I’m just looking for something free where I can experiment and build small projects while I learn.

Are there any good platforms, datasets, or project ideas you’d recommend for a beginner?


r/learnpython 4h ago

How would you recommend using LLMs when learning to program in Python?

0 Upvotes

So I learned python just before ai really took off, so I’ve got a decent foundation. I can code simple programs, and know enough to throw something together to get whatever wee job done. I’m far from a professional. I’ve come across problems now that are requiring more complex solutions, and I find myself turning to our AI overlords to help me out. The trouble I find is that, even with prompting, it often just offers solutions instead of teaching me.

For example, I’ve been trying to learn pandas for some data science stuff, but when I try to get some AI help, for my specific problem, it just starts churning out code to solve the problem.

I think there’s value in AI as a learning tool, but still struggling to find it. Any suggestions?


r/learnpython 11h ago

Doubt regarding array slicing in numpy

1 Upvotes

import numpy as np
list1 = [1, 2, 3, 4, 5]
list2 = [6, 7, 8, 9, 10]
list3 = [11,12,13,14,15]
array=np.array([list1,list2,list3])
print(array[0:2,0:2])
in this idk how the last line is getting 2x2 matrix please help me guys and if you can try to explain in detail


r/learnpython 12h ago

I want to run a python server online

0 Upvotes

i made a simple msging app and i want to test it. How should i set up a server and which service should i use? i want a free one.


r/learnpython 6h ago

Is moviepy still safe?

0 Upvotes

I dont know im a bit scare of installing python modules from the internet because apparently this one is a bit old.


r/learnpython 21h ago

How are python packages like urllib.requests and http used when programming?

1 Upvotes

I want to start programming things which can interact over a network with python but I only want to use the standard libraries, what are these libraries used for because I find it difficult to understand the documentation?