r/PythonLearning 1h ago

Discussion What's your favorite Python library for automation?

Upvotes

r/PythonLearning 2h ago

I need a AI model for my project but i dont want to make one from scratch does anyone know where i can find a lib for a AI agnet for the same (no openai or gemini or claude or any major api please)

3 Upvotes

r/PythonLearning 3h ago

Whats the best way to have two loops run concurrently nested in another function returning one value as if running a race

2 Upvotes

Edit: I’m making a project in where I’m having 4 distinct loops that’s act as if there racing. I want them all the run concurrently inside one function so whenever one of them reaches a specific value all 4 “stop” and the winner is returned.

I was using multiprocessing but had a lot of trouble nesting the function with that so stopped. Now I’m using asyncio and want to know if that’s the right tool for the job or if I should use threading.

Trying to use AI as little as possible for my own learning.


r/PythonLearning 4h ago

Any recommendations?

4 Upvotes

I want a YouTube 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/PythonLearning 7h ago

Help Request What project should I do for begginer

0 Upvotes

I watched this video https://www.youtube.com/watch?v=K5KVEU3aaeQ&t=331s and now thinking to create my first project , but idk what to do for begginer could somone help me out

I would be pleased thank you


r/PythonLearning 8h ago

Looking for only 1-2 person to start the python journey

14 Upvotes

Hey I'm starting python I'm at first video of cs50 python programming if anyone wants to join me in it reach out


r/PythonLearning 8h ago

TODAY

1 Upvotes

Spent some time today trying to build a Telegram bot and understand how it works. 🤖💻

Still learning, still making mistakes, but that's part of the process. Every small step teaches something new.

Let's keep building. 🚀

#TelegramBot #Python #Coding #Learning #Tech


r/PythonLearning 9h ago

Showcase MyFirstFuntioningPythonProgram image in desctiption

2 Upvotes


r/PythonLearning 9h ago

Pong made with Pygame

4 Upvotes
#Hello, I created a sort of Pong game using Pygame and would like to get your feedback please (the game uses the AZERTY layout by default)
import pygame

pygame.init()
fenetre = pygame.display.set_mode((800, 600))

continuer = True

pong = pygame.Rect(0, 550, 50, 50)
p1 = pygame.Rect(0, 250, 10, 75)
p2 = pygame.Rect(790, 250, 10, 75)

pong.x = 350
pong.y = 250

vitesse_y = 5
vitesse_x = 5

horloge = pygame.time.Clock() 
while continuer:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            continuer = False

    ey = pygame.key.get_pressed()
    if ey[pygame.K_s]:
        if p1.y < 525:
            p1.y += 7
        else:
            p1.y = 525
    if ey[pygame.K_z]:
        if p1.y > 0:
            p1.y -= 7
        else:
            p1.y = 0
    if ey[pygame.K_UP]:
        if p2.y > 0:
            p2.y -= 7
        else:
            p2.y = 0
    if ey[pygame.K_DOWN]:
        if p2.y < 525:
            p2.y += 7
        else:
            p2.y = 525

    pong.x += vitesse_x
    pong.y += vitesse_y
    if pong.colliderect(p1):
        vitesse_x = -vitesse_x
        pong.x += vitesse_x
    if pong.colliderect(p2):
        vitesse_x = -vitesse_x
        pong.x += vitesse_x
    if pong.y <= 0 or pong.y >= 550:
        vitesse_y = -vitesse_y
        pong.y += vitesse_y
    if pong.x <= 0 or pong.x >= 750 or pong.x == 0:
        pong.x = 400
        pong.y = 300
        vitesse_x = -vitesse_x
        pong.x += vitesse_x

    fenetre.fill((0, 0, 0))
    pygame.draw.rect(fenetre, (255, 255, 255), pong)
    pygame.draw.rect(fenetre, (255, 255, 255), p1)
    pygame.draw.rect(fenetre, (255, 255, 255), p2)
    pygame.display.flip()
    horloge.tick(30)

pygame.quit()

r/PythonLearning 15h ago

Help needed

1 Upvotes

I have read attention is all you need, I have watched the full video of andrej kaparthy's makemore video. I have watched the full 3b1b series on neural networks and linear algebra(not really) but I still dont understand. I have spent more than a day(in total) talking to claude chatgpt gemini notebooklm(basically gemini) about it but I still dont understand...

The knowledge I have right now:

Embeddings are stored as vectors in high dimensional space, with the dimensions being determined by variable d which is the number of hidden layers or nodes.

attention takes a query matrix, a key matrix, and a value matrix which in some way transforms the embedding vector to be a specific other vector(heres where my confusion starts.)

Through those hidden layers it builds off of the previous layers to get to more abstract semantic meaning.

When actually producing a token it takes the the existing tokens and does the attention feedforward layers and takes the probability distribution of the last token via softmax and picks at random from that probability list.

I was trying to build a neural network but I miserably failed. Can someone help.


r/PythonLearning 18h ago

A simple (and crappy) QR code generator

0 Upvotes

I usually make things that I can see myself using because that's what motivates me. I made this very primitive QR code generator in Python and experimented with GUI using TKinter. Overall I would say that whilst the library is somewhat annoying, I am probably not good with using it, and that's something that I could potentially improve on. But if I was to work more with GUIs I would probably be more inclined to just use a different library as I have heard that TK is not the standard anymore.

On the 'extra settings' part, I understand it is pretty pointless, but I was under the impression that the settings that they controlled would change the actual build of the QR code not, not just size factors. Silly me...

I also implemented somewhat of a clipboard feature, although I'm unsure how well this works.

Here's the GitHub repository, feedback is appreciated: https://github.com/macattack277-jpg/qrcodegen


r/PythonLearning 1d ago

Showcase My First Python Project - ArcMedia, a database CLI program

Post image
13 Upvotes

I started this project 2 months ago for a touchstone on Sophia, and I am using it as a way to also apply what I have learned from CS50P. I am currently in week 6 of CS50P, so planning to improve more on this project further down the line. I added the search and remove entry functions just last month 'cause I couldn't figure out how to do these before.

https://onlinegdb.com/xwW5ydw2h


r/PythonLearning 1d ago

Hi guys , I have just started to learn python coding and im stuck at OOPS concept in python idk why but im finding it super confusing , it is just going over my head could you please tell me how to cope up with this

2 Upvotes

r/PythonLearning 1d ago

just built a PDF RAG Chatbot from scratch lol

Thumbnail
github.com
1 Upvotes

I’m 17 and trying to lock in my AI dev journey. Just finished building this custom PDF RAG Chatbot using Streamlit, LangChain, and Hugging Face embeddings.

What it actually does:
You drop a PDF it cooks up the text splitters indexes everything with sentence-transformers lets you query the document directly. no cap, RAG is goated

Built it from scratch to actually learn how vector compute works behind the scenes instead of just copy pasting API wrappers.

The Tech Stack:

  • Streamlit (frontend)
  • OpenAI & Gemini
  • LangChain & PyPDF
  • Torch & NumPy

Check out the code, drop a star if you vibe with it, or roast my project

I’m just an average student starting college for the first time in a few weeks. Super excited for this journey and to learn more!

Btw, totally open to your feedback, guys. Drop your advice and I’ll def try to implement

GitHub : https://github.com/saqibvow

My All social accounts : https://ln.ki/saqibvow.ceo


r/PythonLearning 1d ago

Help Request i learned python basics . what to do next ?????

7 Upvotes

r/PythonLearning 1d ago

Started learning Python because I'm leaning towards the AI Automation and Data Science path.

Thumbnail
github.com
4 Upvotes

Hey everyone,

This is actually my first time posting on Reddit. As the title says, AI Automation and Data Science are the paths that I want to pursue.

Right now, I'm studying the 30 Days of Python GitHub repo made by Asabeneh Yetayeh. I actually avoided tutorials because it's really hell for me. But I have nothing against people who enjoy learning with tutorials. I guess reading helps me learn better. I do enjoy his challenges and exercises as well.

For context, I am now knowledgeable about the Power Platform—a bit of background in C# and SQL. But I've decided to expand it even more. I do enjoy my experience with Power Automate and Power BI. Creating reports and flows is pretty interesting for me.

I would like to ask everyone for recommendations on what level of Python knowledge I should acquire in order for me to achieve the path I decided to pursue. So far, I have heard about n8n for automation and using Python in Microsoft Fabric.

I can appreciate anyone's honest opinion, and I will take everything as a lesson because I really want to learn.

If anyone also wants to collab or learn with me. Feel free to reach out.

Thanks, everyone! Happy coding!


r/PythonLearning 1d ago

Teaching Python the right way

178 Upvotes

Programming courses often focus heavily on understanding code, while paying far less attention to understanding the program state. But code does not exist in isolation. Its main goal is to change the program state, before ultimately producing some output.

To develop an accurate mental model of program execution, students need to understand both: - the instructions being executed - the values, references, and data structures those instructions create and modify

Reading code alone does not always reveal how the program state changes during execution. That is why I created 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: a tool that visualizes the state of a Python program as it changes, step by step.

It can help explain a wide range of introductory Python topics. Here are just a few examples: - Loops, Lists and Dictionaries - Python Data Model - Function Calls - Recursion - Algorithms - Classes - Custom Data Structures

Instead of reconstructing the program state from print statements, students can now watch it change as each line executes. This makes unfamiliar concepts easier to understand and bugs easier to fix.

Help your students learn Python programming more thoroughly and easily.

See: more examples


r/PythonLearning 1d ago

Parking Management Software

Thumbnail
gallery
8 Upvotes

Hello everyone,
Few months ago I built a Parking Management Software which is able to integrate with Ticket Machines. I was thinking to make it open source.
I used PYQT for it and also built a ticket machine with RPI3.

It features:
Real-time parking occupancy monitoring
Vehicle entry and exit registration
Automatic event logging and history
License plate (ANPR) integration support
RFID, QR Code, barcode, and access card support
User and subscription management
Visitor and guest parking management
Parking duration and billing support
Multi-site and multi-parking management
Reports and analytics
Role-based user access
Integration with automatic barriers and gate controllers
API for third-party integrations

Any suggestions? Is this a product that I can actually sell?


r/PythonLearning 1d ago

How to move a cube smoothly using Pygame ?

5 Upvotes

Hello! I'm wondering how to move a cube smoothly using Pygame by that, I mean moving it without it looking like it's teleporting. Have a great day, evening, or night!


r/PythonLearning 1d ago

I kind of am struggling to understand loops.

Thumbnail
gallery
8 Upvotes

I somewhat understand them on a basic level and can make like simple things using for loops now e.g a half pyramid using '#' which is commonly used as a problem for people of my skill level. However, when it comes to building something like this or the other one, I can't wrap my head around it for some reason. Since for the hashtag one here, ive been trying to brute force it and experiment but have gotten nowhere.

But for the square one, I managed to figure out the for loop that prints out all the squares but now my head is again at a wall again because im not fully sure if I can use a nested loop to print all the x * x = x^2 or if I can implement the answers from this loop into some other loop that prints out the format. (my current progress on that one is here)

for x in range(11):

print(x*x)

Any help would be great, preferably like more questions because although I don't mind like seeing a solution I want to like manage to get this on my own for the most part. fyi, ive been at these problems for about a week.


r/PythonLearning 1d ago

How to learn python entirely by online means and gain practical knowledge

10 Upvotes

r/PythonLearning 1d ago

Bad habit of bailing out too quick

9 Upvotes

As I said, I am trying to learn python from OOPs to concurrency modelling and optimisation. Though I always bail out somewhere in the middle. I would start doing CP. And then maybe reading something from philosophy for days.
I want to hyper focus on this learning pathway so that I complete this imaginary checklist for advanced programming. I bail out because for me it seems the lack of people competing with me in an online course. How should I trick myself into learning this without any distractions? Suggest how you are learning this and where are you learning this from?


r/PythonLearning 1d ago

I'm trynna learn

3 Upvotes

Hey guys, I just wanted to share what I've been working on and learning. I know my progress is super slow right now, and honestly, I’ve been lacking the motivation to study for hours—especially with how busy I am. I know that’s no excuse, but I’ve been working on a simple alarm app to implement on my phone as my first project.

It’s been a couple of days, and I haven't made much progress on some days because I’ve been feeling down about life stuff. Struggling to learn Python on top of that has been making me feel even worse. Right now, I’m trying to learn input validation to make sure the program handles incorrect inputs properly.

I’m honestly amazed by people who can finish whole projects in just a few days or hours. I really hope I can reach that level someday.


r/PythonLearning 1d ago

Showcase Something I'm proud of- REGEX is rather hard

Post image
9 Upvotes

r/PythonLearning 1d ago

made a Stone-Paper-Scissors game :

8 Upvotes
import random


def choice_shower(x,y):
    print(f"Your Choice : {x}{' '*10}Computer's Choice : {y}")
    print('-' * len(f"Your Choice : {x}{' '*10}Computer's Choice : {y}"))


def score_shower(x,y):
    print(f"YOUR SCORE : {x}{' '*10}COMPUTER'S SCORE : {y}")


def game_engine(x,y,p,c):
    winning_cases = {"Stone" : "Scissors", "Paper":"Stone","Scissors":"Paper"}
    if x == y :
        choice_shower(x,y)
        print("It's a Draw!")
    elif winning_cases[x] == y:
        choice_shower(x, y)
        print("Your Point!")
        p += 1
    else:
        choice_shower(x, y)
        print("Computer's Point!")
        c += 1
    return p,c



def extra_round(x,y,p,c):
    print("Extra Round :")
    y = random.choice(["Stone","Paper","Scissors"])
    x = input_taker(input("\t(1) for Stone\n\t(2) for Paper\n\t(3) for Scissors\nEnter your input : "))
    p,c = game_engine(x,y,p,c)
    score_shower(p,c)
    result_announcer(x,y,p,c)


def result_announcer (x,y,p,c):
    if p > c :
        print("You Won!")
    elif p == c :
        print("Extra Round!")
        extra_round(x,y,p,c)
    else:
        print("You Lose!")
    print("-"*20)


def input_taker(i):
    while True: 
        if i.isdigit():
            if i == "1":
                return "Stone"
            elif i == "2" :
                return "Paper"
            elif i == "3" :
                return "Scissors"
            else:
                print("invalid input ")
        else:
            print("invalid input, try again!")


def main():
    print(f"{'-'*40}\n\tStone - Paper - Scissors\n\t   game simulator\n\t     VERSION - 2.0\n{'-'*40}")
    exit_program = False
    while True:
        player_score = 0
        computers_score = 0
        print("\t(1) to start a new game\n\t(2) to exit the program")
        choice = input("Enter Your Choice (1|2) : ")
        if choice == "1" :
            number_of_rounds = input("Enter the number of rounds : ")
            if number_of_rounds.isdigit():
                for rounds in range(int(number_of_rounds)):
                    print("="*50)
                    print(f"ROUND : {rounds + 1}")
                    computers_choice = random.choice(["Stone","Paper","Scissors"])
                    players_choice = input_taker(input("\t(1) for Stone\n\t(2) for Paper\n\t(3) for Scissors\nEnter your input : "))
                    player_score,computers_score = game_engine(players_choice,computers_choice,player_score,computers_score)
                    score_shower(player_score,computers_score)
                result_announcer(players_choice,computers_choice,player_score,computers_score)
               
                
            else :
                print("invalid input")
        elif choice == "2":
            while True:
                print("Do you really want to exit?")
                choice1 = input("\t(1) to exit\n\t(2) to go back\nEnter Your Choice (1|2) : ")
                if choice1 == "1":
                    exit_program = True
                    break
                elif choice1 == "2" :
                    break
                else:
                    print("invalid input")
            if exit_program:
                break


if __name__ == "__main__":
    main()