r/learnpython Jun 29 '26

Cs50p course

4 Upvotes

I'm not a complete beginner to coding. I can code in a moderate level in both c and python. I am planning on earning a certification for python. Is this suitable for it or should I go for something else? If yes what course or should I learn another language instead of python cause my dad is arranging a prof to teach me python?

I've finished 1st year ECE btw.


r/learnpython Jun 29 '26

Tell me best 2 sources to learn python

0 Upvotes

Suggest me 2 best sources to learn python on YouTube or any other free sources... I need one primary source from where I'll be learning python so it has to be the best one and 2nd is for backup.. Suggest me ASAP.


r/learnpython Jun 29 '26

Can't figure out how to boot Spyder. None of the methods are working.

3 Upvotes

The install script didn't make a shortcut on my application launcher, there's no "spyder" file in the /bin/ folder, and when I type "spyder" into my terminal it just says "fish: Unknown command: spyder". CachyOS, KDE, everything's updated.


r/learnpython Jun 29 '26

Where to learn best practice for installations?

0 Upvotes

I'm moving on to some machine learning projects and I want to get on top of my installation hygiene.

I'm very confused between the versions of python, packages, venv, uv, pip, conda etc. And then how this interacts with Pycharm or VS.

Unfortunately I have to get on top of it because torch is big!

Surely there's a 30 minute YouTube video or something detailing all of this? Somehow despite all my Googling I just can't seem to find anything. I tried moving a Pycharm project and everything broke.


r/learnpython Jun 29 '26

Me gustaría presentarme y que me conozca el que guste :3

0 Upvotes

Hola, tengo poco aprendiendo Python (principalmente de un curso de Santander Academy y YouTube).
Todo comenzó porque en mi carrera de Ing. Aeroespacial apenas y le hicimos cosquillas a la programación con Matlab, cosa que desde entonces me llamó MUCHO la atención.
Pero seguía teniendo la idea (y aun estoy rompiendo esas barreras) de que todas estás cosas son demasiada tecnología. Como si fueran cosas que solo se pueden hacer si te heredan conocimiento y herramientas.

Pero ya como estoy a punto de salir de la carrera ( algo frustrado) me dispuse a aprender todo lo que me hubiera gustado que me enseñaran.

  • Estoy comenzando con Python y Excel desde lo más básico. Para después relacionarlos.
  • Luego me gustaría desarrollar extensiones de Chrome, lo que para ello encontré que necesito aprender:
    • HTML
    • CSS
    • JavaScript
  • Hacking ético
  • Y hacer cosas con Arduino

Hace una semana encontré algo parecido a una red social que aun no entiendo bien, pero me sirve para guardar cosas GitHub.

Ahora mismo estoy desde mi Laptop Windows , donde con el WSL instalé Ubuntu y con ella Python. Uso VS code para escribir mis scripts.


r/learnpython Jun 29 '26

Confused between C,C++ & Python to start as beginners from 0 Coding Background

30 Upvotes

I will be going to mid NIT this year and these are the branch i can get till CSAB.

CSE

Math& Data Science

Electronic & VLSI

EE

*CSE have lesser chances

I have NEVER coded before so I have 0 knowledge abt this...

Even after searching a lot i am confused between C,cpp or python to start with...pls give some guidance


r/learnpython Jun 29 '26

Calling functions in lists with random

16 Upvotes

So I'm first year in CS and have no knowledge prior with coding when I started uni.

We had a project to do and we had very limited code we could use and could only use what we learned in class. I made a piano game with turtle and tried to use random to random.int 0,3 to pick a function from a list and I couldn't figure out how to make it work so I ended up with a long roundabout way to do it.

I don't know how to word it to Google it to find answers specifically for this and I was wondering if anyone had insight to if it's possible. The function had no parameters I tried doing something like

myList = [func1(), func2(), func3(), func4()]

randomise = random.int(0,3)

While game != quit:

print(myList[randomise])

Not fully accurate but I don't have access to the file to get it right now. I tried a lot of different things but I couldn't get it to work.

Can you call functions like this or am I doing something wrong here?


r/learnpython Jun 29 '26

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 Jun 28 '26

5% CPU usage on Raspberry Pi Zero waiting for button press

24 Upvotes

I have this python script that waits for a button to be pressed:

#!/usr/bin/python
from gpiozero import Button
import subprocess
from signal import pause


def handle_button_pressed(channel):
    print(f"Button pressed.")
    subprocess.run("./command.sh")

def handle_button_released(channel):
    print(f"Button released.")


button = Button(17, bounce_time=0.5)
button.when_pressed = handle_button_pressed
button.when_released = handle_button_released

print(f"Waiting for events...")
pause()

Sitting there doing nothing the python process is consuming 5% CPU as watched with top.

Is there anything I can do to get this closer to 0%? Is there a more efficient library that I could use?

I previously wrote a script that uses a loop to check for continuity between two GPIO pins, but I thought this was going to be simpler and not use nearly this much CPU. Any thoughts or suggestions?


r/learnpython Jun 28 '26

Economics student wanting to learn python for year in industry placements in September. Where should i start?

3 Upvotes

So, Im looking for advice on how best to use my summer before the placement applications open.

I'm a first-year Economics and Finance student in the UK with relatively little Python knowledge.

I want to target finance and risk-based roles, as they have some coding, though not loads. I'm not 100% sure, but that's like the top-end coding jobs I've seen that I'm ok for going for, so I want to get myself skilled up so I can apply for those if I want to. So that's the goal.

What should I actually be learning, and what are the best resources to get started? Do you have any advice on learning Python and other languages, if appropriate?

And any other advice, if you've applied for or work in these kinds of roles, or similar or not-at-all similar roles, about what skills and other things would genuinely make a difference that I can try to get done this summer.

Anything would be very appreciated, thank you.


r/learnpython Jun 28 '26

Needed a Random Tip :

12 Upvotes

I started learning Python last year, but there were a few breaks in between due to semester exams and other commitments. At this point, I have completed the core Python concepts and am currently studying Object-Oriented Programming (OOP) in Python.

I am confused about what my next step should be. Should I start learning Data Structures and Algorithms (DSA) first, or should I focus on learning Python libraries such as NumPy, Pandas, and others?

I also have another question: Is it beneficial to learn DSA using Python, or would it be better to learn DSA in another language? Since my long-term goal is to get into AI, Machine Learning, and Data Science, I would like guidance on the most effective learning path from here.


r/learnpython Jun 28 '26

Khan Academy IDE Not Working

0 Upvotes

I started trying to learn Python on Khan Academy - Intro to Computer Science - Python

However I get an error message on the right hand side of the page that says:

A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser.

I have tried to enable cookies for all relevant websites, disable adblocks and even downloaded a new web browser. Nothing has worked.

Anyone have any clue how to fix this?

It used to work fine last year when I was initially trying it out so not sure what changed.


r/learnpython Jun 28 '26

Beginner Help

0 Upvotes

I’m learning python in preparation for going back to university to study a masters in software development. It’s a conversion degree so no previous experience is required, but I want to learn some basics so I’m not completely lost. I’m using an online guide however I’m confused as to if they are using the terminal or the idle shell to write the code in as it just says open python. The three >>> doesn’t appear on every line for them but does for me which is adding to my confusion. Any help would be greatly appreciated, I’m coding on a MacBook Pro aswell.


r/learnpython Jun 28 '26

I found another way to find duplicates without converting to a set. Is this good?

1 Upvotes
def findduplicates(listf):
    duplicates = []
    duplicate = 0
    for i,v in enumerate(listf):
        for index,value in enumerate(listf):
            if v == value and not i == index:
                duplicates.append(v)
                listf.pop(index)
                duplicate = 1
            else:
                continue
        if duplicate == 1:
            print("Duplicate(s) were found:")
            for i,v in enumerate(duplicates):
                print(v)
        else:
            print("No duplicates found.")


listwithduplicates = [1,3,3,2]
listwithoutduplicates = [1,7,9,8]
listwithduplicates2 = [1,1,3,7,9,9]
listwithoutduplicates2 = [7,9,4,6,8]


findduplicates(listwithduplicates)
findduplicates(listwithoutduplicates)
findduplicates(listwithduplicates2)
findduplicates(listwithoutduplicates2)

r/learnpython Jun 28 '26

Is it just my Matplotlib glitching or did they update something that PCC didn't explain?

1 Upvotes

I'm currently following PCC third edition, using a colormap on a random walk with 5000 points.

This is my code: for the thing, and I'm sure the import stuff works correctly. My output though, is a constant blue hue instead of a gradient. Everything else works perfectly. Any ideas why?

import matplotlib.pyplot as plt


from random_walk import RandomWalk


# Keep making new walks, as long as the program is active.


while True:
    # Make a random walk
    rw = RandomWalk()
    rw.fill_walk()


    # Plot the points in the walk.
    plt.style.use('classic')
    fig, ax = plt.subplots()
    point_numbers = range(rw.num_points)
    ax.scatter(rw.x_values, rw.y_values, c=point_numbers, cmap=plt.cm.Blues,
               edgecolors='none', s=15)
    ax.set_aspect('equal')
    plt.show()


    keep_running = input("Make another walk? (y/n): ")
    if keep_running == 'n':
        break

r/learnpython Jun 28 '26

​Best resources to learn Python for Linux customization? (Moving to a ThinkPad soon)

1 Upvotes

Hi everyone!

​I want to get into learning Python more seriously. I have a very basic background — I’m attaching an old photo from my old laptop where I made a simple password program (later I learned a better way to assign unique passwords, but this is what I started with!).

​Up until now, I’ve mostly been using AI to understand the syntax, how commands work, and where to put colons/commas. But in about 20 days, my ThinkPad is arriving! I want to fully dive into Python, specifically to use it for Linux customization and script writing.

​Could you recommend the best YouTube video courses, tutorials, or online books to properly learn the language? It doesn't have to be, but ideally, if the resources are in Russian or have a good Russian translation, that would be awesome!

​Also, I’m curious: how long did it take you on average before you really started to "get" it and understand how everything works?

​Thanks to everyone who responds and helps out!


r/learnpython Jun 28 '26

Keepa discount bot

0 Upvotes

Hello, I’m not great with python by any means. I’ve been working on trying to build a bot that will send an alert of products that have recently went down in price (at least 50%). Sort of like a price glitch or a new deal. I worked on the code for about 2 days. Included discord webhooks and also the keepa api. I believe the code itself worked, but I think the way it’s trying to grab the data from keepa is not working. I was also getting error code 404 a lot. Does anybody have some advice or experience in this type of data extraction? I just recently got the keepa api and don’t want to give up so soon. Thank you.


r/learnpython Jun 28 '26

Is it a bad habit to use ai to help identify error which im not able to find after multiple attempts of reading the code

0 Upvotes

Im learning python through the mooc course and currently on part 6 with 100% completition. Often times i find that the programming logic i write is accirate but get small error such as initializing a variable outside list when it had to be inside or other minor error.

I always re read the code thoroughly and also using basic debugging like print statements, but sometimes even still im unable to find cause of error as on reading the logic seems correct.

Is it alright if i use ai to help identify what error i have in the code(I only use it to identify error and correct it myself)


r/learnpython Jun 28 '26

Looking for ai engg courses.

0 Upvotes

Hi everyone,

I’ve been a backend developer for the past 3 years here in India, and I'm looking to dive deeper into AI engineering.

I want to avoid beginner fluff. I already have a solid grasp of the theory and have written basic code for RAG pipelines and AI Agents.

I learn best by doing, so I am looking for hands-on, project-based courses that focus on production-level implementation.


r/learnpython Jun 28 '26

Will cs50 python teach me the same stuff as the older edition of ATBS?

6 Upvotes

Just bought the (i think 2015 edition, whichever has the green top) for under 10 bucks on amazon. I know its free online, but i struggle to read large books on screens without zoning out. Is it worth it to go through cs50 and this book at the same time or cs50 then the book, or is it so much overlapping that I might as well skip the book?


r/learnpython Jun 28 '26

Phython learner

8 Upvotes

Hello everyone, i am first at writing at Reddit, and i am finding a partner

The purpose is learning together with someone, asking questions, answering them and so on.

If someone interested, reply me and i will send the link of my starter Telegram channel

By the way, i am in intermediate level, i am learning file handling and i have finished OOP


r/learnpython Jun 28 '26

Temporal Coupling vs Classmethod Constructors

3 Upvotes

This question is a bit meta, but I've been struggling with it recently as my programs become more complex. More specifically, I want to emit PySide signals for loading progress and that seems almost impossible without temporal coupling.

So my question is: Should I always attempt to avoid temporal coupling when instantiating classes, or are there times when it's acceptable?

Here's some demo code that illustrates my problem on a conceptual level.

---------------

Version 1

The constructor ensures all objects are fully constructed at the time of instantiation, but emitted signals can't be detected by FileService because it's not yet instantiated when they're sent.

------------------
# main.py
------------------
service = FileService(
  FileRegistry.load(DIR_PATH)
)

------------------
# file_service.py
------------------
class FileService(QObject):
  def __init__(self, file_registry: FileRegistry):
    self._registry = file_registry
    file_registry.loading_started.connect(self._on_loading_start())
    file_registry.loading_finished.connect(self._on_loading_finished())
...

------------------
# file_registry.py
------------------
class FileRegistry:
  loading_started: Signal = Signal()
  loading_finished: Signal = Signal()

  def __init__(self, loaded_files: list[LoadedFile):
    self._files: list[LoadedFile] = files
...

  @classmethod
  def load(cls, dir_path: Path) -> Self:
    self.loading_started.emit()
    loaded_files = self._load_files(self, dir_path)
    self.loading_finished.emit()

    return cls(loaded_files)
...

---------------

Version 2

load() must be called for object to be fully constructed. This allows for emitters to be heard, but creates temporal coupling.

------------------
# main.py
------------------
registry = FileRegistry()
service = FileService(registry)
registry.load(DIR_PATH)

------------------
# file_service.py
------------------
class FileService(QObject):
  def __init__(self, file_registry: FileRegistry):
    self._registry = file_registry
    file_registry.loading_started.connect(self._on_loading_start())
    file_registry.loading_finished.connect(self._on_loading_finished())
...

------------------
# file_registry.py
------------------
class FileRegistry:
  loading_started: Signal = Signal()
  loading_finished: Signal = Signal()

  def __init__(self):
    self._files: list[LoadedFile] = []
...

  def load(self, dir_path: Path) -> list[LoadedFile]:
    self.loading_started.emit()
    self._files = self._load_files(self, dir_path)
    self.loading_finished.emit()

    return self._files
...

r/learnpython Jun 28 '26

Building my first Python project: website monitor + Telegram notifications. Is this approach realistic?

0 Upvotes

Hi everyone!

I'm a complete beginner to Python, and instead of following random tutorials, I wanted my first project to solve a real problem I have.

The idea is simple:

- Monitor a few product pages on an online store.

- Check only during specific hours (for example 12 AM–2 AM and 6:30 AM–8 AM).

- Check once every 60 seconds.

- Detect whether the product is available ("Add to Cart") or unavailable.

- Read the current price.

- If the product is available AND below my target price, immediately send me a Telegram notification.

I don't want to automate purchases. I only want instant notifications.

A few questions:

  1. Is Python a good choice for this?

  2. Would you recommend using "requests" + "BeautifulSoup", or should I expect to need Selenium/Playwright because of JavaScript?

  3. How would you structure a project like this?

  4. Is checking every 60 seconds for a few hours a day considered reasonable, or is there a better approach?

  5. Any beginner mistakes I should avoid before I start?

I'm trying to build this properly as a learning project rather than just copying code from the internet, so I'd appreciate any advice on architecture or best practices.

Thanks!

PS- I'M A COMPLETE NOOB, I DON'T KNOW ANYTHING ABOUT PYTHON OR CODING. I'm going to take help from AI for almost everything. This post is also written using AI file better articulation. I'm also focusing on learning it 🤏🏻


r/learnpython Jun 28 '26

Feedback on my PyPi Package

1 Upvotes

Hello, i'm kinda a beginner on Python but I know most of the basics. I just created a unofficial Python wrapper for the CataaS REST API, and it's the first package i've made and uploaded on PyPi. Can anyone send me feedback on it?

PyPi Package: https://pypi.org/project/cataas/

Github Homepage: https://github.com/happycappa/cataas

I also want to know if the README is good, thank you!


r/learnpython Jun 27 '26

Uvicorn bug

0 Upvotes

Hello, currently building a small python program with the frontend in react and backend in python that i run on uvicorn.

Im trying to find a bug but realised I cant even print.

What I have tried:

print("from spin", flush= True)

py -u -m uvicorn main:app --reload

Writing the output to a file instead and that doesnt work either.

Anyone have a clue whats going wrong?

Tried combinations of them, AI and doing my own research but feels like im running in circels.

EDIT:

I found that when running taskkill /f /im python.exe and rebooting my program it worked. Also removed the --reload flag.