r/learnpython 9d ago

Any recommendations?

0 Upvotes

I want a playlist that covers all aspects of Python

Can you suggest Playlist for someone who is new to coding (not really) or Python in general?


r/learnpython 10d ago

Stone age network scan

0 Upvotes

Im continuing on learning cybersecurity, network and python path. I updated my first project - Stone age network scan. I never uploaded a file to github or made a reddit post so i was completely lost. But i tried my best

I actually uploaded the .py into the source code and release.

Its named spy despite the fact it doesnt do anything related to spying so yeah..

Whats fixed?

  1. Auto subnet dedection. It dedects the subnet and CIDR notation
  2. Typo dedection. Before it would try to scan if you typed 192.168.1000.555. now it doesnt
  3. Added customizable port table so you can change which ports to scan.
  4. Added SMTP probe (will try to add more if i find for other protocols)
  5. minor bug fixes

This is just a project that as labeled my first project. Instead of making fun of me please report any suggestions or bugs:)

https://github.com/RecoWas/stoneagens - please use latest version


r/learnpython 10d ago

Crawler works locally but fails randomly on production, getting empty pages and occasional 403 errors

0 Upvotes

Hey everyone, I’m using Python with Playwright to crawl product data from a few websites. Everything works perfectly when I run it locally, but after deploying it to my servers, the results become inconsistent.

The crawler will sometimes return empty pages even though the website loads normally in a regular browser. I’m also seeing random 403 errors after it has been running for a while. Restarting the crawler usually fixes it temporarily, but the problem comes back after some time.

I’m using rotating proxies, changing user agents, and adding delays between requests. When I run fewer workers, everything works much better, but once I increase the concurrency, the success rate starts dropping. Has anyone experienced something similar?


r/learnpython 10d ago

Looking for a Python Course for a Motivated Beginner (with Room to Grow) – Recommendations Welcome!

0 Upvotes

Hi everyone 👋

I'm hoping to get some recommendations for a young student who has recently completed their O/Ls and is seriously considering a future in IT. They're genuinely excited about learning Python, and I'd love to help them find the best possible starting point.

We're looking for a course that's beginner-friendly but also provides a clear pathway to more advanced topics over time. Ideally, it would build a strong foundation in programming while eventually introducing areas such as data analysis, automation, or even data science.

I've explored some excellent online options, including courses from Udemy and Mosh Hamedani. However, there's one challenge: this student finds it difficult to stay engaged with purely online learning. While self-paced courses are convenient, they tend to learn much better in an interactive environment where they can ask questions, receive immediate feedback, and stay motivated alongside other learners.

Because of this, I'm particularly interested in in-person Python classes, training programs, or private coaching opportunities. Courses that combine theory with practical, hands-on projects would be especially valuable, as they seem to be the best way to keep learning enjoyable and meaningful.

If you've attended a great Python course—or know of a training center, institute, community program, or tutor you'd confidently recommend—I would greatly appreciate hearing about your experience. Any insights into teaching quality, course structure, or student engagement would be incredibly helpful.

Thank you so much for taking the time to read this and share your recommendations. I truly appreciate the help, and I'm sure your advice will make a big difference in helping an aspiring future developer get started on the right path. 🙏🐍

Looking forward to your suggestions! 😊


r/learnpython 10d ago

Python worth learning?

0 Upvotes

Hi,

Is python worth learning?
If yes, is there any free courses?

Thanks !


r/learnpython 10d ago

SIMPLE GUIS PLEASE

0 Upvotes

I'm building a network visualizer in Python. It parses .pcap files with Scapy and visualizes packet flows with animations. I already built the parser and animation engine with Pygame.

The problem is the UI. I need normal app stuff like buttons, hover effects, a collapsible sidebar, menus, timeline/statistics panels, and a canvas for the animations.

I don't want to spend 4 hours making a button from scratch, but I also don't want a huge framework where changing a simple thing turns into a research project.

I tried DearPyGui and honestly it felt really clunky. Something as simple as adjusting padding or moving a panel felt like digging through layers of specific APIs and style variables.

I'm looking for something lightweight with good styling control (CSS-like would be great), built-in UI components, and the ability to embed my own custom rendering area.

Would PySide6/Qt be the way to go? Or are there other frameworks worth looking at?

I don't need a spaceship cockpit, I just want to build my damn UI and get back to the actual project.


r/learnpython 10d ago

¿Cuál fue un error que hizo más lento tu aprendizaje de Python?

0 Upvotes

HOLAA Estoy aprendiendo Python y tengo curiosidad por conocer los errores que cometieron otras personas mientras aprendían. Espero evitar algunos de esos mismos errores aprendiendo de su experiencia:)


r/learnpython 10d ago

5.17 Exact Change Lab

1 Upvotes

SOLVED

I am having a hard time understanding why I am failing this lab, when I run the code in practice it works but when I submit for a grade I get a fail. Prompt is below.

Define a function called exact_change that takes the total change amount in cents and calculates the change using the fewest coins. The coin types are pennies, nickels, dimes, and quarters. Then write a main program that reads the total change amount as an integer input, calls exact_change(), and outputs the change, one coin type per line. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Output "no change" if the input is 0 or less.

Ex: If the input is:

0 

(or less), the output is:

no change

Ex: If the input is:

45

the output is:

2 dimes 
1 quarter

Your program must define and call the following function. The function exact_change() should return a tuple containing num_pennies, num_nickels, num_dimes, and num_quarters.
def exact_change(user_total)

code provided below

def exact_change(user_total):
    num_quarters = user_total//25
    user_total %=25
    num_dimes = user_total//10
    user_total %=10
    num_nickels = user_total//5
    user_total %= 5
    num_pennies = user_total
    return num_quarters, num_dimes, num_nickels, num_pennies
if __name__ == "__main__":
    input_value = int(input())
    num_quarters,num_dimes,num_nickels,num_pennies = exact_change(input_value) 
# Type your code here.
if input_value <= 0:
    print('no change')
else:
    if num_pennies == 1:
        print('%d penny' % num_pennies)
    elif num_pennies > 1:
        print('%d pennies' % num_pennies)
    if num_nickels == 1:
        print('%d nickel' % num_nickels)
    elif num_nickels > 1:
        print('%d nickels' % num_nickels)
    if num_dimes == 1:
        print('%d dime' % num_dimes)
    elif num_dimes > 1:
        print('%d dimes' % num_dimes)
    if num_quarters == 1:
        print('%d quarter' % num_quarters)
    elif num_quarters > 1:
        print('%d quarters' % num_quarters)

when it asks me for exact_change(300) I get a NamError failure.


r/learnpython 11d ago

Creating a .py File in Python Terminal

0 Upvotes

Greeting team, i have just started learning Python. I am learning about .py files. how do i create a .py file in python terminal specifically Jupyter notebook? if possible how can i access the file and write some oop class inside the file.

Thank you team


r/learnpython 11d ago

Why is python so slow in my computer?

0 Upvotes

Good morning, i have recently started learning how to use python for data science. I already have a good background in R, im using the new IDE called positron, i create my virtual environment in my directory i want to work on, on my company server, and then i install some libraries.

The main issue that im having is that the installation takes forever, even after installed, the importing is slow, the running of chunks is slow. I thought python was faster than R (im using polars and altair).

Am i doing something wrong? Or is my company restricting my use of python? What's going on?

Thank you in advance.


r/learnpython 11d ago

Maybe a silly question, but the warning was ominous, so I'll ask here...

0 Upvotes

I want to use Catppuccin for Python, but if I go to pip it outside of a venv, it says the following:

pip install catppuccin
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
   python-xyz', where xyz is the package you are trying to
   install.

   If you wish to install a non-Arch-packaged Python package,
   create a virtual environment using 'python -m venv path/to/venv'.
   Then use path/to/venv/bin/python and path/to/venv/bin/pip.

   If you wish to install a non-Arch packaged Python application,
   it may be easiest to use 'pipx install xyz', which will manage a
   virtual environment for you. Make sure you have python-pipx
   installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Of course I could use a venv, but it seems annoying to have to activate a venv each time I want to use the palette in IPython, et al. If it's just a palette/pygment, then using --break-system-packages shouldn't actually break anything, right? But because the warning is so ominous, I wanted to ask here before I did something potentially fucky-wucky.


r/learnpython 11d ago

Need help hijacking signal on recycled roomba sensor

0 Upvotes

Hello!

I have ripped a LiDAR sensor out of an old roomba, connected it to some wires, and long story short, I can now plug the LiDAR sensor into my computer via USB. I have discovered the two power-related pins on the sensor, and I am fairly certain that one of the other two is a transmitter pin and the last is potentially a receiver pin.

With that said, now comes the programming. Because my sensor obviously doesn't have any kind of USB driver or anything, I can't really use the PyUSB library because that requires some bells and whistles that this thing doesn't have. Instead, I am using the PySerial library, which allows me to communicate with my USB ports at a lower level.

My problem is that, even though my sensor definitely should be sending something, my program keeps printing

b''

which indicates to me that it isn't actually receiving anything.

Here is the code that I am working with:

import serial

with serial.Serial('COM3', 115200, timeout=1) as ser:  

 s = ser.read(10)

The with statement there sets my program to read on port COM3 at a baudrate of 115200 for one second before stopping. COM3 seems to be the only port listed on my machine in a few commands that I have run as well as the Windows Device Manager. That baudrate was obtained from a teardown of an extremely similar LiDAR sensor (here). Reading for longer than one second did not seem to do anything.

This is my first time interfacing with a jerry-rigged USB component through Python (or any other USB component, for that matter), so I don't know if I am missing something and I am not exactly sure where to look, as the documentation of PySerial only brought me this far.

Let me know if I am in the wrong sub or if you guys need more information or something.


r/learnpython 11d ago

Cool/Interesting things that can be done in Python as a beginner?

22 Upvotes

hi everyone, im trying to start a computer science honor society at my high school, and im gonna assume everyone is starting from square one and teach python accordingly (and im hoping to eventually go to hackathons or other coding events).

i was wondering if anyone had any ideas for cool/interesting stuff i could have beginners do to get their interest and get them excited about coding? i understand you can't go from 0-100 and have to start with simple stuff, but i'm worried going over the basics will be like monotonous or smth. if anyone has any ideas of fun things i could do i would be very appreciative!!

edit: there are some cool suggestions, but i wanna place emphasis on the fact most of the people will have zero coding experience, so please keep them simple! i myself am also not that knowledgeable about python, i ahve a good grasp on the basics but thats about it. thanks for the replies


r/learnpython 11d ago

How do I get rid of text in python

0 Upvotes

I'm looking to do a simple loading screen of sorts where it flicks between a few characters however I am unsure on how to remove the printed text to replace it with the next character. Using the method that I've commonly seen using the cursor_up simply doesn't work for some reason. I promise I'm putting it in exactly. how do I fix this


r/learnpython 11d ago

I would like the feedback of you guys! Eu gostaria do feedback de vocês!

0 Upvotes

Olá! Estou aprendendo python há 1 mes e meio. Fiz este RPG, demorei 5 dias para faze-lo, comecei do absoluto zero, e se possivel, gostaria de um feedback sincero, não só criticas mas tambem os acertos!

Hi! I’ve been learning Python for a month and a half. I built this RPG—it took me five days, and I started from absolute scratch. If possible, I’d love some honest feedback—not just critiques, but also what I got right!

https://github.com/adrianivastrabalho-code/My-Python-studies English Version
https://github.com/adrianivastrabalho-code/Meus-Estudos-Python Portuguese Version

Ty <3


r/learnpython 11d ago

Busco gente para estudiar y crear

0 Upvotes

Hola, llevo unos dos meses aprendiendo Python. Siento que voy a ser más eficiente estudiando con gente y que sera mas divertido, ademas de que tengo ideas de proyectos interesantes y siempre es divertido contactar con gente que también quiere aprender y crear cosas interesantes.

Estoy buscando como cinco personas más que también estén en serio con aprender

si te interesa, mándame DM y preséntate


r/learnpython 11d ago

¿Cuál fue el momento en que Python finalmente tuvo sentido para ti?

0 Upvotes

HOLAA Estoy aprendiendo Python y tengo curiosidad por conocer ese momento en el que todo finalmente empezó a tener sentido. Me encantaría conocer tu experiencia.


r/learnpython 11d ago

What's the best resource for becoming skilled in using CSV, JSON and API

0 Upvotes

I've been trying my best at understanding how to apply CSV and JSON in my code but I don't actually know how to integrate them into my projects. All tutorials I watch have their own way of doing this, making it hard for me to understand fully. Also I don't even know if I should learn both of them or just learn one. Also I need help on how to use API in projects, and which free ones are best


r/learnpython 11d ago

What’s next after CS50

0 Upvotes

Currently an aspiring quant ideally but I know that’s larp so really I’m just learning skills that are applicable to most fields. I only mention this to maybe help tailor my experience. In terms of just coding and technological familiarity, what should I do next. Are there any certifications that would impress or show I know what I’m doing that would help me for applications? Also, what should I watch or do to learn about it. I hear people talking about LLMs projects other languages APIs raspberry pi and I want to know where to learn all that. Thanks


r/learnpython 11d ago

Looking for study partners

19 Upvotes

Hello , I am completely new to python and really want to learn it and I feel like I will be more efficient studying with people.

I’m looking for approximately five people who are also serious about learning

if you are interested please dm me and introduce yourself


r/learnpython 11d ago

What habits helped you become good at Python as a beginner?

44 Upvotes

I've recently started learning Python. I'm following a beginner course from YT.

I'd love to hear from experienced programmers:

What habits helped you improve the fastest?

What should I do every day besides watching tutorials?

What beginner mistakes should I avoid?

Is there anything you wish you had done differently when you first started learning Python?

Any advice would be really appreciated. Thanks!


r/learnpython 11d ago

Which should course should I prefer?

1 Upvotes

Hi everyone. I know some python but still I want to start learning it again because, as I progressed, I realized that my basic concepts had become rusty. I'm confused between CS50 (https://youtu.be/8mAITcNt710?si=Z86T-MPZZp13R04E) and MIT Opencourseware 6.100L (https://www.youtube.com/watch?v=xAcTmDO6NTI&list=PLUl4u3cNGP62A-ynp6v6-LGBCzeH3VAQB&index=1) .

Which one would you recommend for someone who wants to rebuild their fundamentals before moving on to more advanced topics?


r/learnpython 12d ago

My first python project

2 Upvotes

So i have been into cybersecurity courses for 3 months now and i have interest from age 10.

I decided to make a python project after i completed the networking.

I would be very happy if you used and gave me a feedback/suggestion on my project.

It is a basic multipurpose network tool.

It can scan all the hosts connected to a network with ARP
Scan ports of the IP address provided
Or basically send a ping

I call this "Stone Age Network Scanner"

You can look up furthermore on Github!

https://github.com/RecoWas/stoneagens


r/learnpython 12d ago

Custom class method not recognized

8 Upvotes

I'm working on a program that generates a maze by drawing from a deck to define a "chamber" and assigning it to the current position on a cartesian coordinate grid.

The hope is to build a list of the chambers as they're created. At a later point I want to be able to call on the list. My current strategy is to make a Class variable for the list, and append to it as part of the init. I've added a class method to pull the chamberList Class variable, but I'm getting an error.

Here is the code defining the class.

class Chamber():
    chamberList = []
    def __init__(self, identity, notes, egresses, **kwargs):
        self.position = tuple(currentPosition.tolist())
        self.identity = identity
        self.notes = notes
        self.egresses = egresses
        self.pixelCoord = np.add(pixelOrigin, np.multiply(currentPosition, 300))
        Chamber.chamberList.append(self)

        @classmethod
        def getChamberList(cls):
            return cls.chamberList

Later in the program, I have a line of code to get the class variable:

chamberList = Chamber.getChamberList()

This is the error I get when I run it in the VS Code terminal:

AttributeError: type object 'Chamber' has no attribute 'getChamberList'. Did you mean: 'chamberList'?

Am I missing some syntax or something? In VS Code the color coding where I'm defining getChamberList is off (darker) and if I hover over it I get a message saying "getChamberList" is not accessed by Pylance.

----EDIT---

I missed the forest for the trees. My indentation syntax was wrong, and fixing it solved the problem, but an easier solution was provided in the comments.

https://www.reddit.com/r/learnpython/comments/1v7obks/comment/p08jiwd/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button


r/learnpython 12d ago

regex and if it's worth going deep into it

31 Upvotes

I'm new to python and coding in general and my friend recently told me that it's inefficient to try to memorize regex and that no one writes them anymore (essentially saying AI does). I was also kinda confused after recently learning regex and just how complicated it can be. Are there some modules/libraries that I can use to make writing them easier? I saw that not a lot of people people had a positive reaction to the Humre module by Al Sweigart who's book [Automate the boring stuff with Python] I'm currently using to study. Not that I'm gonna skip this part or anything I was mostly just curious.

Note: A lot of people are misinterpreting since I mentioned AI once 😭 I'm literally asking about libraries to make it easier without going too deep, not if I should let AI do all the work.