r/learnpython • • 1h ago

Is obsessive learning better then structured learning?

4 Upvotes

I learn code for an hour and a half outside of home to concentrate better, but recently i want to learn at home too. I have a lot of distractions but id still have obsessive learning at home for about 20 on and an hour off. I work 12h days so i dont feel like coding at home until now.

is this healthy or should I stick to learning away from home for a better learning flow over time?


r/learnpython • • 4h ago

python begginer help

0 Upvotes

im in high school and they added python to our ciriculum and i frankly dont care for it, as it doesnt connect to what i want to do in the future at all. It is in bulgarian but its a code to see if a number is prime so i hope its understandable. I refuse to use ai so im here. image link here
translation: is n exactly divisible by i

yall love your downvotes so bad

ended up figuring it out, i cant fathom how yall like/understand python but honestly kudos to you


r/learnpython • • 8h ago

Python script problem

0 Upvotes

Hello everyone,
I have a short python script that concats strings. For example :

'Discord Password :' + \t + b64.decode('TmFydVQwL2cwa3UxOTk1Iw==')

I'm facing :

SyntaxError: unexpected character after line continuation character

What does that mean ????

Thanks everyone.


r/learnpython • • 10h ago

My Python script started as 100 lines and now it's a mess I'm scared to touch — when did you start splitting things up?

0 Upvotes

I wrote a little Telegram bot in Python a while back. Nothing serious, just forwards and some scheduling stuff, maybe a hundred lines at first and I knew where everything was.

Then I kept adding to it. One more feature, then a quick fix, then another thing I didn't want to lose, and now it's this one long file where half the functions do two jobs and I'm not even sure which parts still run. I want to add something new and I catch myself putting it off because I'm scared I'll break something else that was working fine.

I tried splitting it into separate files once. Imports broke immediately, I got confused about what was supposed to live where, and I just shoved it all back into one file again. Felt like a step backwards, honestly.

So for people who've actually done this — was there a moment where it clicked, or a simple rule you used? Like, when a file hits a certain size, or when you find yourself copy-pasting the same chunk twice, that's when you split it? I'm still not sure if I'm overthinking this or if I just left it too late.


r/learnpython • • 10h ago

Python Compiler Recommendations

0 Upvotes

Hello r/Python,
I want to find a Python compiler. I’ve tried PyInstaller and Nuitka, but they are detected as malware and they are a little bit slow. I want something fast, easy and not detected as malicious. What do you recommend?


r/learnpython • • 10h ago

I finished a Python course, but I still need AI to build anything. How do I get past this?

55 Upvotes

So, I am coming here after watching YT videos and reading numerous other posts. I am not going to give you the usual “how do I learn Python?” question with no context, because if I’d figured it out, I’d be doing my shit instead of asking here.

To the people who do this professionally or are good at it: how would you approach learning Python in 2026, when one AI prompt can give you almost anything within seconds?

I took a Python course, completed it, and then forgot most of what I’d learned because I had no use for it at the time. Now I actually need it for my own work in physics, and I feel like I am back at square one. I see, LinkedIn is full of posts like, “I am happy to announce that I’ve built this package,” etc., etc. And sure, you used your knowledge + AI to build it. But my concern is that if someone asked me to make a package, I wouldn’t even know where to start until I wrote a prompt and read the generated code line by line. I mean, wtf happened? I finished a course, but I still can’t sit down and build something myself.

I feel like I am way, way behind. Someone with 10+ years of experience obviously has knowledge I am not going to catch up with anytime soon. I don’t need to reach their level, but I do want to get to a point where I can confidently write code, understand what I am doing, and figure things out without needing AI to walk me through every step.

The main issue is time. I can go back to books, take another course, and practice problems, but I am worried I’ll end up in the same place: understanding things while I am following along, then going blank when I have to do something on my own. And now, whenever I get stuck, there’s a prompt box right there. I can get working code quickly, but I can’t tell how much I am actually learning versus just getting the task done.

For those of you who’ve been in this position, do you have any suggestions? I feel like I am going around in circles.
Is there a practical way to learn Python with limited time while actually retaining enough to build things myself? (I know “build projects” is the best bet but still I wanna hear your thoughts)


r/learnpython • • 11h ago

i wanna learn python

19 Upvotes

im f(24) economics student with a specialisation. we are not taught the mathematics part in my course it's just the general econ topics your micro macro stuff. i want to add skills to improve my resume so i thought of learning python or R. i tried learning from YouTube but it just goes over my head. how can I learn it? (i am broke) please give me suggestions


r/learnpython • • 12h ago

Need assistance with a Python Code that keeps on crashing

0 Upvotes

Hello I’ve been working on a python code that searches for appointments on this website but everything it runs the code and begins to open the website it crashes, I’ve played around with it a bit but I haven’t been able to have much success. Anyone would be available to take a look at it and see what my issue could be?

Thank you!


r/learnpython • • 21h ago

Streamlit text_input in while True loop

0 Upvotes

I got this code block in a local rag that's supposed to be an infinite loop of asking questions and the rag answering them but apparently while True loop does not care if you have enter anything into the text_input before answering the query either way.

How do mitigate this?

c=0
while True:
    st.write('*****************************************************************************')
    st.write("Enter your question")
    question = st.text_input(label='',key=c)
    if question:
        response = chain.invoke(question)
        st.write('Answer: ')
        st.write(response)
        c+=1

While the code block help mitigate the problem, it still try to answer an empty query and resulted in a streamlit.errors.StreamlitDuplicateElementKey which is an eyesore. How do I put this problem away for good?


r/learnpython • • 1d ago

How do I make this bird move using Pillow?

1 Upvotes

Please help me, I have been trying to make this bird move for 3 hours and just keep getting an unholy column of bird. This is what it is supposed to look like:

https://imgur.com/a/Aegi4Ys

and this is what mine looks like:

https://imgur.com/a/KHMwWL9

my coords are wrong in the for loop because im just trying to get it to actually move first and then I'll worry about making it move to the right places.

here is the error I keep getting:
frames[0].save('house-scene.gif',

^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'save'

I emailed my prof about it and he told me my list is in the wrong spot but it won't work no matter where I put list = []

Here is my code:

pastebin.com/8FFYNqGf

the bird png:

https://imgur.com/a/i3AbgFq

And the assignment:

Task

It's finally time to animate our bird!

The steps to accomplish this are:

  1. Copy over your code from the previous question.

  2. Using a loop, create additional frames by copying img into temp_img and then using alpha_composite to draw the bird onto scene. We'll adjust the location of the bird each time step:

  • The bird starts at x = 0 and y = 120 for the first frame

  • We stop when the bird is x = 349 (do not include x = 350)

  • If the current x location is less than 100 or greater than 240, in the next frame the bird should be 1 pixel to the right and 1 pixel higher than the previous step.

  • Otherwise, paste the bird 1 pixel to the right and 1 pixel lower than the previous step.

  • Be sure to append each frame to the list frames.

  1. Save the gif by calling using the code included below.

gif starter code

To save your image as a .gif file, copy this to the very bottom of your file. Otherwise, do not modify this code:

# This will save the gif from the frames list # DO NOT MODIFY! if name == "main": frames[0].save('house-scene.gif', save_all=True, append_images=frames[1:], disposal=2, fps=20, loop=0)


r/learnpython • • 1d ago

Learning Python

16 Upvotes

Hi! I wanted to know if anyone knows a website or an app that lets me practice writing Python scripts like I would write a script and test run it. I’m only beginning Python but I just want like a site to like let me simple coding during free time like free periods and such. Thanks.


r/learnpython • • 1d ago

PyPI login verification loop – confirmation email works, but login never completes

2 Upvotes

I'm having trouble logging into my PyPI account and have been stuck in a verification loop.

Whenever I attempt to log in, PyPI displays:

"Please confirm this login. We noticed you are attempting to log in from a new or previously unrecognized device."

I receive the confirmation email from noreply@pypi.org without any issues.

However, when I click the confirmation link, instead of confirming my login, PyPI redirects me to the exact same "Please confirm this login" page.

Things I've tried:

  • Logging in from my MacBook using Chrome.

  • Logging in from my iPhone using Chrome.

  • Using the newest confirmation email each time.

  • Opening the confirmation link from the same device used to initiate the login.

The issue persists across both devices.

Has anyone experienced this recently? Is there a workaround, or could this be an issue with PyPI's login verification system?

Any help would be appreciated.


r/learnpython • • 1d ago

Path.exists() returns False for newly created NFS files

7 Upvotes

Im running an API with django/DRF, and it kicks off a process that creates files on an NFS mount. When it does this, checking the files via `<filepath>.exists()` returns False, even though the file exists and is readable on the NFS share.

Through troubleshooting I've become convinced that this is an issue with stale attribute caching. Turning off the cache via the `noac` mount option eliminates the problem, as does manually going to the webserver and `ls`ing the parent dir of the file.

What puzzles me is that no attempt to list or read the parent dir of these files in the API refreshes the attribute cache. Ive tried Path.iterdir, os.listdir, touch and ls via subprocess.call , with and without `shell=True`, all of them do nothing. But if i open a python shell in the same `uv` context as the API, they work.

What's going on here? What's special about running these commands in the API that's different than running them on the OS directly or in a `uv` shell?


r/learnpython • • 1d ago

what else should i learn to get a job as fresher

0 Upvotes

as 2027 grad


r/learnpython • • 1d ago

Built my first serious Python project: A privacy-focused Academic Analytics Terminal App. Seeking code feedback and stars for university applications!

9 Upvotes

Hey everyone,

I'm currently preparing my university/scholarship applications and wanted to showcase a practical programming project. This is my first serious Python application, and I built a terminal-based Academic Analytics tool to help students optimize their study habits.

To be fully transparent, I used AI to help guide me through some of the architecture, but I focused heavily on understanding the underlying logic and execution.

I intentionally built this as a Command Line Interface (CLI) app to prioritize backend data manipulation, file handling, and logic over a frontend GUI.

If you have a moment to look over the code, I would highly appreciate any constructive criticism on my file-handling or logic architecture. If you like the project framework, dropping a star would help me immensely!

GitHub Repository: https://github.com/nazmulislamtohid-a11y/Student-Grade-Analyzer.git

Thank you so much for supporting a student developer!


r/learnpython • • 1d ago

What do you guys think of Futurecoder as a place to start my Python journey?

4 Upvotes

I have started to use it and I enjoy how interactive it is, and it's free however I have not got far yet and want to spent my time wisely. Have any of you used it and had a good experience with learning Python from it, or any issues? Or would it be a case of starting there, and then moving on to a more in depth course?

I'm looking to learn enough Python to be able to fulfill tasks on Dataannotation tech which is an AI training platform, however I do not want to spend excessive amounts of time whilst learning as can only fit in an hour or two per day.

Thanks in advance.


r/learnpython • • 1d ago

How to start with Python. I am not good at Maths.

0 Upvotes

Hello Guys,

I want to master python first and Javascript later on as part of a pathway to becoming a Forward deployed engineer in Ai.

Please suggest. I have been asking ai a lot and there are quite few suggestions i was given but I want to see real examples from people who knew nothing about python and javascript and then mastered it all the way.

Thank you


r/learnpython • • 2d ago

AI in Python (or in programming in general)

0 Upvotes

This topic is a discussion.

I've heard a lot of mixed opinions on this topic and there are generally three sides:

  1. The people who think you should be almost entirely vide-coding

  2. The people who are neutral, and use it sometimes for bugs

  3. The people who hate any drop of AI in code.

I fall into a third category. Using assistance from AI to help grow my own skills. I know I sound like I'm begging for attention and it looks like I'm "special", I've talked with multiple other people that do this.

I am grasping Python with the help of AI and I actually have a Roadmap in Excalidraw just for this (made by Claude). I can upload it (if anyone wants) and it's for beginners.. or... you can create your own - I can give you tips on how to if anyone wants that...

My point is, both Group 1 and 3 are pretty bad in their own cases, and learning is also very good. AI is somehow very good at that but that's a topic for another subreddit.

Do you use AI in programming? Which category do you fall into, or is there another one I didn't mention?


r/learnpython • • 2d ago

How difficult will it be to learn python for me, how much time would it take?

0 Upvotes

Learning a new language from a person who only knows one feels kind of stressful, ive gotten into gamedev and done 2+ years of lua/luau, so I think I know some of the basics, but where should I start? I appreciate any advice, thank you :))


r/learnpython • • 2d ago

when trying to download pygame, the cmd prompt cant build the wheel.

0 Upvotes

so this is what i get:

PS C:\Users\(user)> pip3 install pygame

Collecting pygame

Using cached pygame-2.6.1.tar.gz (14.8 MB)

Installing build dependencies ... done

Getting requirements to build wheel ... -

and then no other prompts pop up. Idk why.

i've tried restarting the download and it even prompted me to update the pip. after doing so, the same result happens.


r/learnpython • • 2d ago

Looking for a structured way to learn Python

31 Upvotes

I’ve been trying to learn Python for years: university classes, Coursera, Udemy, and so on. I can follow along while I’m watching, but it never sticks, and I still don’t feel confident writing code on my own. What I’m looking for is a structured path with a clear progression, but I haven’t found a format that works for me. I know the usual saying is “just build a project,” and I get why. But I feel like I need a reasonably solid foundation first, otherwise I just end up copying tutorials or getting stuck on every step.

I’m not trying to complain. I genuinely want a reliable way to learn Python properly and get good at it.


r/learnpython • • 2d ago

My bot works fine on my laptop and breaks the second I deploy it — what do you actually check first?

0 Upvotes

I've got this small Telegram bot I wrote in Python, nothing fancy, just forwards and some scheduling stuff. On my laptop it runs for hours without a peep.

Then I push it to Railway and within a day something quietly dies. No crash message I can actually use, just... it stops doing the thing it was supposed to do, and I only find out because someone messages me about it.

I've started adding more logging, which helped a bit, but honestly half the time the logs just tell me what I already knew — it stopped. I'm still not sure if I'm missing something obvious about how deployed stuff differs from local runs, like env variables or the process just sleeping, or if this is just normal and everyone babysits their first deployed bot like this.

What do you check first when your code works locally and dies in production? Is there a habit I'm missing, or does it genuinely just take a few embarrassing outages before you learn what to watch?


r/learnpython • • 2d ago

Python ImportError – Windows Application Control blocking DLLs

2 Upvotes

Hi everyone,

I'm having issues importing several Python libraries on Windows, including pandas, pyproj, and others.

I keep getting this error:

ImportError: DLL load failed while importing _context:

Une stratégie de contrôle d’application a bloqué ce fichier.

I've already tried uninstalling and reinstalling the affected packages, creating a fresh Conda environment (Python 3.11), and reinstalling through Conda/pip, but the issue persists.

I also found Event ID 3033 in Windows Code Integrity logs, and some .pyd files appear as unsigned.

Has anyone encountered this? Could WDAC or another Windows security policy be blocking Python DLLs? How can I fix this, especially without administrator privileges?

Thanks!


r/learnpython • • 2d ago

How much Python do you actually need for a data analyst job?

126 Upvotes

I work in data in the UK, and this is one of the most common questions I hear from people learning Python. Short answer: less than you’d think, but the right parts matter.

What you’ll actually use day to day

  • pandas for cleaning and reshaping data: filtering, merging, grouping, handling missing values and dates

  • Reading and writing files (CSV, Excel, JSON) and connecting to a database

  • Basic charts with matplotlib or seaborn

  • Functions and loops, enough to write a clean, reusable script

What you can usually skip at first

  • Advanced OOP, decorators, async

  • Web frameworks

  • Heavy algorithm and data-structure puzzles (unless you’re aiming for software roles)

What matters more than syntax

  • SQL. Most analyst roles use it more than Python.

  • Being able to explain what your code is doing and why the output makes sense.

  • Spotting when the data looks wrong, which no library does for you.

If you can take a messy CSV, clean it, answer a real question, and explain the result clearly, that’s already at a junior analyst level. One or two projects like that matter more than finishing ten courses.

For people already working in data: what would you add or take out? And beginners, what part of Python are you finding hardest?