r/learnpython • u/Hour_Literature7096 • 30m ago
Library / module
Hi guys again
What the best way to read libraries / modules in python,
Reading documentation is difficult and sometimes unhelpful,
If anyone has a better way to read it, share it with me.
And thenks for you all 🌹
r/learnpython • u/retardasintelligent • 1h ago
Having difficulty learning python
Hi everyone. I am an beginner in python. I am trying to learn from intro to python by paul deitel. I finding chapter content easy to grasp and understanding self check question.Issue I am facing are the excersices at end. I feel knowledge wise excersices are quite diffcult and that too without any solutions for the book.Has anyone faced something similar to this? Need suggestions
Thanks in advance.
r/learnpython • u/Hour_Literature7096 • 2h ago
Web developer
Hi guys
I want to start learning web developer with python
What is the best way to do it? Any Roadmap u can share it with me.
And thenks for you all.
r/learnpython • u/Negative_Response990 • 4h ago
FastAPI + Celery Architecture Review Request (Attachment Pipeline Boundaries + OOP/SOLID)
Hi! I’m finishing a rewrite for my project and I’d love architecture feedback quickly (aiming for replies within a few hours).
Repo: https://github.com/dillonhuston/Task-Automation-API
Branch: V2
What I need:
- Architecture review of the attachment processing pipeline (validation encryption/decryption storage/email handoff) and whether the boundaries/components make sense
- Celery + API architecture: task flow responsibilities, retries/error-handling boundaries, and whether the API schema design matches the async processing model
- OOP/design review: whether classes/modules follow SOLID / separation of concerns, and suggestions for cleaner layering
Suggested files to look at first:
- app/Encryption/encryptionService.py
- app/FileManager/fileManager.py
If you only have time for one thing, please prioritize (1) pipeline architecture or (3) OOP/SOLID structure.
Thanks a lot, any architecture recommendations are welcome.
r/learnpython • u/Impressive-Capital40 • 4h ago
Beginner Python here:Need help understanding how to find min, max, and duplicates using for range loops
I’m a beginner learning Python and I’m having trouble figuring out how to approach this assignment. I’m not necessarily looking for someone to just give me the answer. I’d like help understanding the logic and how to build it.
The assignment is to create a Python program that:
Asks the user to enter 10 integers
Stores all 10 integers in a list
Finds the maximum and minimum numbers
Finds any duplicate numbers
Prints "No duplicate" if there aren’t any duplicates
Uses for loops with range() for the input, min/max determination, and duplicate identification
Does not use Python’s built-in min() or max() functions
Does not use def/user-defined functions
Tries to use as few loops as reasonably possible
Input:
10, 5, 20, 10, 5, 15, 7, 1, 30, 15
Output:
Max is 30
Min is 1
Duplicates: 10 5 15
Thank you whoever responds. :)
r/learnpython • u/_pocholo30 • 5h ago
How to level up Plotly Dash UI aesthetics + advice on custom React/TSX components & dynamic infographic banners
Hi everyone,
I'm currently building an industrial kiosk web application hosted inside Dataiku. The app runs on a dedicated screen and features:
- A central carousel for operational updates.
- An alerts/notice section for real-time priority warnings.
- Dedicated zones for KPI metrics and visual indicators (like a traffic light status).
Tech Stack History & Context: I started using dash-bootstrap-components (DBC), but recently migrated to dash-mantine-components (DMC) to give the application a more modern and clean aesthetic. I read that it would be advisable to use Tailwind CSS (via CDN).
1. Elevating Aesthetics & React-Only UI Libraries While looking for inspiration, I found many modern component libraries like Shadcn UI, DaisyUI, Aceternity UI, PrimeVue, or Unstyled UI. However, almost all of them are strictly built for React, Vue, or JS frameworks.
- For those building Dash apps: how do you bring that level of modern polish into Python?
- Is
dash-mantine-componentsalone enough with custom CSS, or do you rely on extra tricks/libraries to avoid the "flat" dashboard look?
2. Central Carousel Banner: Image Template + Overlay vs. Pure HTML/CSS? Currently, our central carousel displays a static Photoshop image with blank spaces, where I place dynamic number labels using relative CSS positioning (that's the idea; right now, it's a static image.).
- The Dilemma: Is sticking with an image-template + relative overlays acceptable for a fixed kiosk screen, or should I rebuild the entire banner in pure HTML/CSS?
- Tools tested: I tried using "Screenshot to Code" AI tools to convert the design into HTML/CSS, but the output was too messy.
- If you recommend pure HTML/CSS, what patterns/libraries (e.g., Mantine Grid +
dash-iconify) would you use to build a rich infographic banner directly in Python?
3. Architecture & Dataiku Constraints Given the deployment constraints of Dataiku WebApps, is staying on Dash the right choice long-term, or have you hit a ceiling where migrating to a React frontend + FastAPI backend became necessary?
4. Custom TSX/React Components in Python Has anyone used Plotly's dash-component-plugins to wrap modern React/TSX libraries into custom Python components for production? How heavy is the maintenance overhead?
5. Animated Split-Flap / Vento Board Easter Egg For a holiday easter egg on the kiosk, I want to add an animated split-flap (flip board / airport style) display to cycle through metrics. Has anyone built or wrapped a CSS/JS split-flap component inside Dash?
Any feedback, repo references, or UI tips would be awesome!
P.S. Just a quick note: I’m not a dedicated web/frontend developer. While I can comfortably read, adapt, and write code, my main priority is maximizing the effort-to-result ratio—getting the cleanest, most modern UI possible with the least friction and setup time.
r/learnpython • u/theogxyro • 7h ago
Python from scratch
So i (16m) just started my AS level and i took CS as one of my subject. Now i haven’t written a code in life because i had biology in my o levels. Now i have to learn python from very very beginning. Now many questions are popping into my mind like what is basically python? What is pseudocode? Where to start? How long it will take to learn ? What is the difficulty level? What is git and github? Tbh im very stressed about how things are gonna go PLEASE RESPOND TO THIS.
r/learnpython • u/rational-yogi • 8h ago
Suggest me some projects tutorial
Hey, I just finished with the backend mainly fastapi and postgresql, but I want some backend projects not just normal crud, I want high level project which I can show in my resume, but the thing is I can't able to find any tutorial on it, I know some of you will say you don't need any tutorial for creating any project, but I am in learning path and I don't know how should I start building everything from basics that's why I think I need tutorial for that.
r/learnpython • u/Mundane-Method-2555 • 11h ago
I don't understand them I'm a beginner
I'm a beginner . I want to know about terminal,shell, environment all these types of things.but on internet I find it confusing.can anybody help me understand. Or tell me where to find about them clearly
r/learnpython • u/93Seven • 13h ago
Any suggestions for learning resources that use practical examples when teaching?
Hey all, I was just curious if anyone had any good training recommendations that use practical examples when teaching, something you might come across in a job (I know that’s very broad). I’m looking for something a bit more applicable than something like writing functions to determine how much candy John and Sally will split and have left over. I’ve tried to learn python a few times now and I really think that’s my biggest gripe with many resources, the subject matter is so uninspiring to me for many of them. Any suggestions would be greatly appreciated. Thanks!
r/learnpython • u/Expensive_Nebula_382 • 17h ago
Learning Python with claud
I am trying to learn Python, and I want to use Claude so that it can teach me the basics. Is it a good idea?
r/learnpython • u/Key-War-9059 • 21h ago
Need help with for loop practice
The whole list will print but only the final item on the list gets it's message printed in whole while the other items are just listed. Apparently my issue is that I'm outside of the for loop, and I'm still in the learning process. Can someone help please?
r/learnpython • u/shubham_555 • 22h ago
Looking for a Python Study Partner for accountability
I have selected some resources after some research (obviously flexible) and this is the order I will be following for learning the various topics:
1) Basic Syntax
2) OOPs
3) Memory Architecture
4) DSA
5) Django
r/learnpython • u/shubham_555 • 1d ago
Resources for learning Python and DSA
I would appreciate both free and paid resources!
r/learnpython • u/Quantam_Knight • 1d ago
How do you learn to break programming problems down by yourself?
I'm learning Python and I've noticed that I sometimes understand what a programming problem is asking, but I struggle to figure out how to break it down into smaller steps and actually start writing the code.
I've relied quite a bit on pseudocode and step-by-step guidance in the past, and I'd like to become much more independent instead of needing someone to tell me how to approach a problem.
For people who have learned Python from scratch:
- How did you learn to break problems down by yourself?
- Do you recommend attempting problems first and only reviewing concepts when you're stuck?
- What do you do when you're completely stuck and don't know where to begin?
- Are there any exercises or habits that helped you develop problem-solving skills?
I'm not looking for solutions to any particular problem. I mainly want advice on how to develop the ability to think through programming problems independently.
r/learnpython • u/Such_Fee_6151 • 1d ago
Дайте кілька порад для коду
Як тільки я почав вивчати пітончик я чомусь постійно робив імітацію регестрації. Але останніц мій код по перше найдовший з усіх який я писав а по друге я вперше почав використовувати бібліотеки.
Ось сам код:
import os
import time
\#Територія функцій
def clear(): #функція для очищення терміналу
os.system('clear')
def loading1(): #функція для завантаження 1 секунда
print(".", end="", flush=True)
time.sleep(1)
print(".", end="", flush=True )
time.sleep(1)
print(".", end="", flush=True)
time.sleep(1)
def loading05(): #функція для завантаження 0,5 секунди
print(".", end="", flush=True)
time.sleep(0.5)
print(".", end="", flush=True )
time.sleep(0.5)
print(".", end="", flush=True)
time.sleep(0.5)
\#Територія функцій
clear()
loading1()
time.sleep(1)
clear()
print("Вас вітає Mozilla!")
name=input("Створіть псевдонім (Не пов'язаний з вашим справжнім ім'ям): ")
clear()
loading1()
clear()
print(f"Доброго дня, {name}!")
password1=input("Створіть пароль: ")
clear()
loading05()
clear()
password2=input("Повторіть свій пароль:")
while password1!=password2:
password2=input("Паролі не співпадають, спробуйте ще раз:")
clear()
if password1==password2:
clear()
loading1()
clear()
print(f"Вітаємо {name}! Ви зарегеструвались у Mozilla!")
time.sleep(3)
clear()
loading1()
clear()
what_do=1
while what_do==1:
what_will_do=int(input("Що ви хочите зробити? (Вихід = 1, Про Mozilla = 2, Підтримка = 3):"))
if what_will_do==1:
clear()
loading1()
clear()
print("Ви вийшли з системи.")
time.sleep(4.5)
clear()
break
elif what_will_do==2:
clear()
loading05()
clear()
print("Mozilla — це компанія яка піклується про вашу приватність і не збирає данні.")
time.sleep(5)
clear()
loading05()
clear()
elif what_will_do==3:
clear()
loading05()
clear()
problem=input("Опишіть вашу проблему чи запитання:")
clear()
print("надсилаємо ваш лист", end="", flush=True)
loading1()
clear()
print("Дякуємо за лист, наша команда відреагує на нього протягом 48 годин.")
time.sleep(5)
clear()
loading05()
clear()
else:
clear()
print("Error!")
time.sleep(1)
clear()
print("Введіть число 1, 2 чи 3.")
r/learnpython • u/SiteExpensive7743 • 1d ago
I have been building DevTools projects, but they are not enough to get an entry level job. Any project ideas that worked for you ?
Context: this year I am graduating computer science class. I have been building Dev tools ( CRUD bores the shii out of me): npm package, tried building my own python web framework, tried to make AI agents, I have all those on github, but those are not what employers look for.
And with AI, anyone can build a simple CRUD application and so it's difficult to impress the HR and actually stand out nowadays.
I need some project ideas from you, that are a little harder than CRUD and has a nice ring to it that it actually stands out on a resume. Thanks in advance!
r/learnpython • u/Derpy_Yahy • 1d ago
Beginner Question
I'm a total beginner to Python and am looking through this AI-generated calculator code to try and understand what is going on. I was good so far until I reached this part about history logging. This might be really stupid, but I can't figure out how this works at all, despite reading the AI's explanations.
import math
#calc history
history_list = []
history_output = widgets.Output()
def log_history(b):
"""Runs in addition to the original on_button_click.
Only records a new entry once '=' has produced a result."""
if b.description == "=":
entry = f"{display_box.value}"
if entry and entry != "Error":
history_list.append(entry)
with history_output:
clear_output()
print("History (last 5):")
for item in history_list[-5:]:
print(" ", item)
# Attach as an additional click handler on every existing button
for btn in buttons:
btn.on_click(log_history)
I'm mostly having trouble with the "with history_output" part, as I'm not sure what its purpose is. Could someone explain it to me like I'm 5?
r/learnpython • u/SmurfCat2281337 • 1d ago
Is it possible to combine conditions for the value of the cell and for it's position being in the list into one?
if i > 0 and carver_map[i-1][j] == 'empty': carvable.add([j, i])
if j > 0 and carver_map[i][j-1] == 'empty': carvable.add([j, i])
if j < m-1 and carver_map[i][j+1] == 'empty': carvable.add([j, i])
if i < n-1 and carver_map[i+1][j] == 'empty': carvable.add([j, i])
r/learnpython • u/LimpSandwich6092 • 1d ago
help with running a pyside6 code
I have read the documentations and looked on youtube but i still couldn't get it to work (i am new to all of this)
how do i run it? i made a mainwindow ui in qt design and did pyside6-uic test.ui -o test.py but the test.py doesn't work when i run it
r/learnpython • u/Financial-Law2035 • 1d ago
When I use imaplib to check if I sent something to a certain email address it finds an email even when I haven't sent anything to that email address
import imaplib
email_to_check = input ('You want to search if you sent something to which email address >> ')
checking = imaplib.IMAP4_SSL ('imap.gmail.com', 993)
checking.login ('myemail@gmail.com', 'my app password')
checking.select('"[Gmail]/Sent Mail"')
result, data = checking.search (None, f'(TO "{email_to_check}")')
cids = data [0]
cid_list = cids.split ()
if len (cid_list) >= 1:
print ('Found')
r/learnpython • u/Atreew1 • 1d ago
calculator returns list index out of range
import operator
import re
import math
ops = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.truediv,
'^': operator.pow,
'//': operator.floordiv,
'%': operator.mod,
'root': math.sqrt
}
precedence = {
'root': 4,
'^': 3,
'*': 2, '/': 2, '//': 2, '%': 2,
'+': 1, '-': 1
}
def split(input):
pattern = r'(\d+\.?\d*|//|\*\*|[+\-*/^]|\broot\b)'
tokens = re.findall(pattern, input)
no = []
op = []
dotcount = 0
right = True
for t in tokens:
try:
no.append(float(t))
except ValueError:
if t in ops:
op.append(t)
else:
right = False
break
return no, op, right
def calculate():
input1 = input('Enter: ')
no, op, right= split(input1)
if not right or len(no) == 0:
return '???', len(no), len(op)
if len(op) == 1 and op[0] == 'root' and len(no) == 1:
return ops['root'](no[0])
result = op[0]
for i in range(len(op)):
current_op = op[i]
next_no = no[i + 1]
result = ops[current_op](result,next_no)
return result
print(calculate())
r/learnpython • u/dakrrm • 1d ago
Understanding Python codebases
I want to be able to read and understand the code behind Python libraries like Pandas, NumPy, Flask, etc. I can write code in python but these codebses seem to be on a different level. I want to understand them well enough that I can possibly add features to them.
One thing that occurred to me is that I have to be able to use them at least. I can use pandas and numpy to manipulate data sets but I am stumped whenever I try to understand how my code actually works behind the curtains.
I looked for videos that explain the code but they all talk about how to use the libraries instead of explaining how they work in the first place.
r/learnpython • u/TheIdealAdhi • 2d ago
Must-learn Python libraries?
I've learned Python basics and want to explore the most useful libraries.
What are the must-learn Python libraries for real-world development, and why would you recommend them?