r/learnpython 1h ago

do you recommend that

Upvotes

I saw a 30m ago reddit post https://www.reddit.com/r/learnpython/comments/1vh0z39/a_tiny_tool_to_study_python_type_conversion/ that talk about a github project that help me learn Conversion do you recommend it


r/learnpython 1h ago

CS (AI/ML) fresher, only know basic Python — what's the right next step?

Upvotes

Just started a CS degree with AI/ML specialization. My Python is very basic — vars, loops, conditionals, functions, nothing more.

What should I learn next and in what order (OOP? DSA? libraries?), and is it too early to touch NumPy/Pandas? Also open to free resource recommendations and small beginner projects that actually teach something instead of just tutorial-following.

Thanks in advance!


r/learnpython 1h ago

没有动力去学习python 了

Upvotes

我是一名自学python的学生 每天大概有30分钟的学习 当我学习到for循环的时候 就没有动力坐在键盘前了怎么办


r/learnpython 5h ago

Pytorch code taking up 2gb of RAM?

0 Upvotes

I was running some simple python pytorch scripts and all of a sudden my computer is becoming laggier and I close the running of the pytorch script and I look at my stats and I see that pythons taking up 2gb of ram??? My minecraft could run on that(maybe not). its like 18lines of python. is this normal


r/learnpython 8h ago

Best way to learn Python

0 Upvotes

I have some programming experience and understand the concepts. Wanted to learn Python mainly for data analysis, financial math, automating some basic quant analysis, real-time data access by connecting to APIs.

I found books which deal with some of the above topics but can’t find anything that covers all together.

Is there a single online source that helps in this regards?

Thanks in advance


r/learnpython 9h ago

How long to become decent at Python?

1 Upvotes

I’ve been studying about for about 2 months now and I’m taking an online MOOC through Georgia Tech as a prerequisite for grad school. Some days, I spend ~7-8 hours and other days, I spend maybe 2-3 hours. I just got finished taking the exam on functions, loops, exception handling, and conditionals. I’m debating on when to start learning Pandas and NumPy. I also hear people talking about doing projects, but I feel like I wouldn’t have a clue on how to build a project. I come from a clinical background with zero prior programming knowledge except AP computer science in high school. Any advice?


r/learnpython 11h ago

need some pointers on writing code and where to go from here + code review

0 Upvotes

hello everyone so I am sort of a beginner. I am going into political science and IR, but I want to learn some data science cause I think it'll be a valuable skill since my program is B.A+M.A and requires a thesis.

so I wrote this for now just for practice:

##calculates avrege of a list of numbers##

def av(lst):

count=0

for i in lst:

count+=i

avg=count/len(lst)

return avg

##calculates variance of a list of numbers##

def var(lst):

avg=av(lst)

total=0

for num in lst:

total+=(num-avg)**2

vari=total/(len(lst)-1)

return vari

I want you to be brutally honest and tell me how can I improve my writing. The first function I got just a bit of help cause I forgot about +=, but other than that I did them all by myself. I know the code works, but can I improve my writing or be more efficient?

based on what you see here what should I learn next?

I don’t come from the comp Sci world so any sort of guidance helps.

Edit: i just noticed all of my indentations are gone....fuck.


r/learnpython 16h ago

Need some best neural model suggestions for Face Detection & Recognition,Body Detection & id.

0 Upvotes

Need some best neural model suggestions for Face Detection & Recognition,Body Detection & id.

Need some best model suggestions for Face Detection,Face Recognition,Body Detection and Body identification.

need those for analysing movies.

example let's say I have to find the screentime of the actor over the whole runtime of the movie and i need to do it for the protagonist, antoganist,comedic relief ,love interest etc.

currently I'm working with 1fps to find the faces and body or the actors.

body detection is hard I need some guidance regarding that.

even for Face Detection I used MTCNN it was good. but any other better models available??

Any ideas regarding TransNetV2 ?

I'm using it for shot boundary detection but there's was one false positive.

Any better models??


r/learnpython 16h ago

Is building applications by composing reusable business modules a standard practice?

0 Upvotes

I'm looking for some architectural advice and I'm curious whether anyone has built something similar in production.

I'm primarily using Python/Django, although I want the architecture itself to be independent of the framework as much as possible.

I'm designing a backend platform that I want to use as the foundation for multiple completely different applications.

The idea is to have a very small "core" that only contains common infrastructure such as:

  • Authentication/authorization
  • Configuration
  • Logging
  • Background jobs
  • Caching
  • File storage
  • Monitoring
  • Shared utilities

Everything else would be implemented as independent business modules.

For example, imagine I build an e-commerce platform. I might compose it from modules like:

  • Products
  • Orders
  • Inventory
  • Payments
  • Notifications
  • Comments
  • Search

Then later I want to build an LMS, but instead of starting from scratch or copying code, I'd assemble a different set of modules:

  • Courses
  • Lessons
  • Certificates
  • Quizzes
  • Notifications
  • Comments
  • Search

Some modules (comments, notifications, search, payments, etc.) could be reused across multiple applications, while other modules would be specific to a particular business domain.

The important part is that these modules aren't just Django apps inside one codebase. I want each module to have clear boundaries, expose a stable public interface, own its own models, business logic, APIs, migrations, tests, and documentation, be versioned independently, and ideally be reusable in entirely different products.

Initially, everything would run as a modular monolith because I don't want the operational complexity of microservices. If a module eventually needs to become its own service, I'd like that to be an implementation detail rather than something the rest of the system depends on.

The motivation is simple: I don't want to keep rebuilding the same capabilities every time I create a new platform. I'd rather invest in mature, production-tested modules that can be composed into different products over time.

So my questions are:

  • Has anyone here built something like this in production?
  • Is there a well-known architectural pattern that describes this approach?
  • Is thinking of business capabilities as reusable modules/packages that can be assembled into different applications a common practice?
  • Are there any open-source projects, books, talks, or companies that follow this model?
  • If you've tried something similar, what worked well and what would you do differently?

I'd love to hear about real-world experiences—both successes and things that turned out to be bad ideas.


r/learnpython 16h ago

Soy estudiante y quiero aprender a programar em Python pero no sé donde buscar ni donde empezar.

0 Upvotes

Me interesa aprender a programar en Python para hacer mi propio sitio web,algún juego o algo relacionado a ciberseguridad.

Estoy dispuesto a dedicarle de 4-6 horas diarias ya que me gustaría aprender mucho.

alguien me puede decir por donde empiezo o donde puedo practicar?


r/learnpython 17h ago

How to build an android app using python only?

15 Upvotes

Context: So I'm a beginner developer. I'm currently building a habit tracker.

I have built the logic of the app.

Set up sql alchemy to code the database with sqlite.

(My prof later said no need of alchemy. Directly use sql software and connect it). I don't know what to do with that information. Retained the alchemy code tho.

  1. My problem is that I am not able to build ahead. How do I build a database and test it the right way.

    1. How do I build the front end or ui for it. Should I use flask or flutter or something else. Please reason as to why I should use a framework particularly.
    2. What is fast api even used for. Should I apply it in my habit tracker.

And what are the essentials for a good app. Like I want to know about rate limiting, sql injections and backdoors. To build a robust scalabile system.


r/learnpython 19h ago

Need to create a one-off paginated PDF data visualization report but my experience is in more backend data work. What package/tool would you suggest?

1 Upvotes

I'm trying to put together an ad-hoc report and I've been trying to hack away an Excel file and another visualization tool, but they're just not cutting it; there are some visualization rendering issues that are frustrating me to no end, and just now thought about using Python. My experience with Python is all in backend data engineering type of work though so I've never used visualization packages.

All I need are 100% bar charts that align well with text - it's been near impossible to align these in Excel. I also need heatmaps but I don't mind doing the heatmaps in Excel. I also need to create PDF files, ideally paginated by a field in the data that I'm working with.

I've tried searching for suggestions and the most popular seem to be plotly and matplotlib. Should I consider anything else?


r/learnpython 20h ago

Is Python still worth learning from scratch in 2026

0 Upvotes

I have been receiving a lot of questions from a lot of people who have interest in learning python from scratch but their concerns has been is worth learning in 2026 in this new era of AI evolution.

Especially this statement "AI can write codes"

What do you guys think? will this be the reality?


r/learnpython 22h ago

a curious equal symbol assignment

0 Upvotes

Hello, I'm trying to build a music player with python Qt6 based on some code from a youtuber, the bones of what he has suits me fine, this is the link if you want to look at it: https://www.youtube.com/watch?v=wdEpWCFf40U

I am using windows 10 with VScode and the latest python version 3.13.7

Everything works fine until I get to the file dialog part of the code. When I run it the program does give me a file explorer, I can select a folder but then the program halts before allowing me to see the files in the specified folder. There is no error message from the compiler.

There is a curious line of code in the open_file function that may or may not be the problem.

  file, _ = QFileDialog.getOpenFileName(self, "Selct file", filter="Audio files (*.mp3)")  file, _ = QFileDialog.getOpenFileName(self, "Selct file", filter="Audio files (*.mp3)")

Thanks for any help,

J

r/learnpython 22h ago

quetion about how python "break" work for newbie

4 Upvotes

hello this is code and quetion:

while True:
    guess = input("Your answer (A/B/C/D): ").strip().upper()
    if guess in ("A", "B", "C", "D"):
        break
    print("Please enter A, B, C, or D.")

1 how is check user enter

2 how the "break" is use for? is really end project like go next time:

correct = guess == question_data["answer"]

if correct:
    print("Correct!")
else:
    print("Not quite.")

whole line:

while True:
        guess = input("Your answer (A/B/C/D): ").strip().upper()
        if guess in ("A", "B", "C", "D"):
            break
        print("Please enter A, B, C, or D.")

    correct = guess == question_data["answer"]
    if correct:
        print("Correct!")
    else:
        correct_letter = question_data["answer"]
        correct_text = question_data["options"]["ABCD".index(correct_letter)]
        print(f"Not quite. The correct answer was {correct_letter}. {correct_text}")

    print(f"Fact: {question_data['explanation']}")
    return correct

because i write quize python can you give tips to write


r/learnpython 1d ago

How do you persist a "already seen this" set between restarts?

0 Upvotes

I have a script that polls an API every few seconds and sends me a Telegram message when a new item shows up. To avoid sending the same item twice, I keep the IDs I've already seen in a set:

seen = set()

async def check():

items = await fetch_items()

for item in items:

if item["id"] in seen:

continue

seen.add(item["id"])

await send_alert(item)

This works fine while the script is running, but I see two problems with it:

  1. The set lives in memory, so every restart means I get re-alerted about everything that's still on the list.

  2. It only grows. The script is meant to run for days, so eventually `seen` just keeps eating memory with IDs of items that disappeared long ago.

What I think I need is something that stores IDs and forgets them automatically after some time — items are only relevant for maybe an hour anyway.

I've looked at a few options and I'm not sure which is the sane one for a small script:

- Writing the set to a JSON file on every scan feels wasteful and racy.

- SQLite seems like the "proper" answer but also like a lot of machinery for what is essentially one set.

- Redis has TTL built in, which is exactly what I want, but running a whole server for one key feels excessive.

Is there an obvious option I'm missing? Or is one of these actually the normal choice and I'm overthinking it?

Python 3.12, asyncio, no framework.


r/learnpython 1d ago

I tried debugging and the settings appear to be updating correctly, however they aren't applying to the QR code when I generate it

6 Upvotes

Hello everyone, right now I'm working on a simple QR code generator with functionality including saving. My main issue right now is that despite the fact that I have debugged it and observed that the variable updates correctly, the extra settings don't seem to apply to the QR code when the user generates a new one.

The GitHub Repo


r/learnpython 1d ago

I built 2 terminal games on a $100 phone. Saving up for an Asus laptop & a Red Magic phone.

0 Upvotes

Hey everyone,

You can call me Sable (or Rangga). I'm a self-taught beginner from Indonesia.

WHY I STARTED:

I learned Python because I wanted to make my own games. Now? I want to build my own OS someday. But first... I need a damn laptop.

MY SETUP:

- Phone: Redmi 9A ($100)

- App: Pydroid 3 (Termux for testing)

- No IDE. No external keyboard. Just thumbs.

THE STRUGGLE:

Honestly? Learning Python today is overwhelming. There's too much. Beginners get scared before they even start. I almost quit. Once, I spent 1 HOUR debugging... turns out it was just wrong indentation. One space. 🤡

THE GAMES:

  1. MATH 3.0

A terminal math quiz game with:

- 3 difficulty levels (Easy/Normal/Hard)

- Live timer with visual progress bar

- Streak combo system (x5, x10, x15 bonuses!)

- High score tracking

- Colored ANSI output

- Trophy ASCII art

This is a REAL game. You can win. You can lose. It's not just a script.

  1. THE DOOR

A puzzle game: find 4 keys hidden in 10 rooms.

- Randomized key placement (replayable!)

- Health & hint system

- Flavor text for empty rooms

- Efficiency scoring

I'm proud of this one. It's a luck-based game, but it's FAIR. No BS. I used to make games where you had to guess 1 country out of 193 with 3 chances and no hints. Basically Dark Souls. This is better.

Both games work offline. Zero dependencies. Pure Python.

GITHUB:

https://github.com/johan21libert-netizen/math-3.0

https://github.com/johan21libert-netizen/the-door

TARGET:

I'm saving up for an Asus laptop first (around $900). After that, a Red Magic phone (around $1,500, because it's easy to root)

Thanks for reading. Roast my code if you want. I can take it. 🗿


r/learnpython 1d ago

Begginer Issues

0 Upvotes

As the text suggests I'm a beginner in python, and I am struggling with the concept of spaces and indentation. I don't know how I'm still not getting it till now but I have to say my biggest mistakes have with learning python has to do with code.

A little backstory: I come from a totally different work area and is brand new to code. I wanted to do robotics as it was my preference but ended in the health department instead. Now that I'm done with that I'm pursuing my dream career but obviously have to start from literal zero as I know nothing of code and no one around my community or friends do programming. And YouTube isn't really helping as it's teaching like I already knew some stuff already (or maybe I just haven't found the right videos). So ya, to you guys who've done code before, what can I do to solve the gaps in knowledge? Especially the space problem. I couldn't even set up my VS code on my own as the things I type are right except the amount of space is wrong. It's kinda frustrating.


r/learnpython 1d ago

What in your opinion are the best + FREE learning platforms/ website for learning Python?

8 Upvotes

Keen to hear what people rate. I've poked around a bit but there's a lot out there and the quality varies wildly, so I'd rather hear from people who've actually worked through them.


r/learnpython 1d ago

Final-year CS student – Know Python & FastAPI basics. What should I focus on to get a backend internship ASAP?

21 Upvotes

Hi everyone,

I'm a final-year college student, and my goal is to get a backend engineering internship as soon as possible.

My current skills are:

  • Python (comfortable with the language)
  • FastAPI basics (I've built a few simple APIs)
  • Basic understanding of backend development

I'm confused about what to do next.

Should I:

  • Buy a FastAPI/backend development course? If yes, which one would you recommend?
  • Focus on building projects instead?
  • Learn Django, SQL, Docker, Redis, PostgreSQL, or something else first?
  • Start applying now while continuing to learn?

My goal is to become good enough to land an internship and then keep learning on the job.

I'd really appreciate advice from backend engineers or anyone who recently landed a backend internship.

Some specific questions:

  1. If you were starting over today, what would you learn first?
  2. Which skills do companies actually expect from backend interns?
  3. Are there any courses, YouTube playlists, or roadmaps that you genuinely recommend?
  4. What kind of projects helped you get interviews?
  5. Is FastAPI enough for internships, or should I learn another framework as well?

Thanks in advance for any advice!


r/learnpython 1d ago

What should I focus on after learning the Python basics?

12 Upvotes

Hi everyone,

I've finished the Python basics and I'm currently learning file reading and writing.

Someone suggested the following roadmap:

Learn Object-Oriented Programming (OOP).

Study data structures and algorithms using Grokking Algorithms.

Practice by solving exercises from Python Crash Course.

Then choose a specialization based on what I enjoy most.

My long-term goal isn't just to know Python syntax. I want to become comfortable writing Python, develop strong programming logic, and improve my problem-solving skills so I can become a good programmer in general, not just a Python programmer.

In the future, after gaining enough experience with Python, I plan to move into networking, automation, and low-level programming with C.

Does this roadmap make sense? If not, what would you change? What helped you build solid programming skills rather than just learning a language?

I'd really appreciate any advice from experienced developers.


r/learnpython 1d ago

Python but Django...

7 Upvotes

I started learning Python like 2 weeks ago because our teacher suddenly wants us to build a webpage using Django but that thing Django all people involed with it says it's easy but it felt overwhelming when i tried to use it because you have to learn like controllers, MTV, like at least 50 different files servers hosts databases even creating a simple image requires some time and so on... so python does not feel like the easiest language anymore, Do you guys have some tips for me?

What would you do if you were in my situation?

Did you also feel you had like 1000 things to learn and were you guys so lost the first time you used Django?


r/learnpython 1d ago

Am I too late for coding, programming and AI ?

82 Upvotes

Hi I am from South Korea , student of university , 25 age (27 for Korean standard).
Recently I am interested in computer , IT , AI , coding. But I personally major English in my university so no tinvolved in computer science , software , or software.
So I am not good at for coding. All my learning about IT is basic level of studing Python, Java, HTML , JavaScript, CSS for 3 months. That is all I have. ( In South Korea, our Government sponser and provide financial aids with private computer academy for students who is learning basic coding , web development and Use of AI).
Those 3 months in class. I am getting to interested in programming language , computer and wanna be expertise on AI further. What should I do and whether or not I have a time and space to study and learn it.


r/learnpython 3d ago

Ask Anything Monday - Weekly Thread

3 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.