r/PythonLearning • • 2h ago

Built my first Random Forest ML API using Python, FastAPI and Docker

1 Upvotes

been learning classical machine learning and recently finished a random forest classification project

it classifies 7 dry bean varieties using 16 numerical features

what i implemented:

  • RandomForestClassifier with 100 trees

  • 5-fold cross validation

  • GridSearchCV for hyperparameter tuning

  • 92.06% test accuracy

  • FastAPI prediction endpoint

  • HTML/CSS interface

  • Docker and pytest tests

also included a confusion matrix, feature importance plot and reproducible training instructions

github: https://github.com/Vaibh37/dry-bean-random-forest

would appreciate feedback, especially on the Python code and model evaluation

if you find it useful, consider starring the repo ⭐


r/PythonLearning • • 5h ago

Beginner at Python with exam in few weeks

4 Upvotes

I got a python assignment due on start dec been doing python courses learning basics past few weeks following uni lectures (few months ago) - but since i had no prior xp and most classmates do i felt on the backfoot right away - struggled with basic exercises but will try them again - plus pandas and numpy for a python programme ain't no beginner assignment unless I'm just that inexperienced


r/PythonLearning • • 6h ago

What do you guys think?

Post image
28 Upvotes

I made a program that finds the second largest digit in a list.

Using the list method "remove()" and "max" function. Python is COOL!


r/PythonLearning • • 9h ago

Discord Server for people trying to learn Python

4 Upvotes

Hey, I am also trying to learn python and have only cleared the basics so far. I thought that wouldn't it be more fun to have more people to collaborate with. I made a discord server where I am hoping to get some more people like me to join and work on fun projects together.

Note: I want it to be more of a friends server rather than a 100+ community since I find that a bit too overwhelming. I want to create a more cozy environment with a few groups of friends. So far I am the only one at the moment of creating the server but I hope I get to meet new friends together.

PS: If you want to do some MineCraft Modding, please do join since I am also planning to get into that stuff in future.

The Server Link: https://discord.gg/JAycFSWXN


r/PythonLearning • • 10h ago

Help Request Advice needed to choose between tech careers

3 Upvotes

Hey everyone, I'm 21 and currently learning German because I want to move to Germany next year for an Ausbildung.I'm interested in IT, especially software development and AI. I've recently started learning Python on my own and actually enjoying it. I've also tried n8n after seeing AI automation trending everywhere. Set it up on my laptop and made a few basic automations with Gemini.But honestly, my main interest is building software, apps and AI-powered tools that solve real problems, make people's work easier and save time and money. Maybe eventually build my own SaaS too.The problem is that AI is developing so fast, companies are laying off people, and I'm confused about which direction is worth investing my time in.Should I focus on software development, AI engineering or automation? Which one has a better future, especially in Germany? And how can I build skills that won't easily become replaceable by AI?

I'd really appreciate honest advice from people working in tech or studying IT I don't want to follow trends blindly and waste years learning the wrong thing.

Thanks in advance.


r/PythonLearning • • 10h ago

Game Theory Game SplitSplat Island

Post image
4 Upvotes

I built a game based on William Spaniel's Game Theory 101 Course using pygame.

https://aprameyaraya.github.io/SplitSplatIsland/


r/PythonLearning • • 10h ago

Parallel and Concurrent Programming in Python: A Practical Guide

3 Upvotes

Hey guys

Made a video which explains the differences between threads and processes in python

and also, what is the difference between concurrency and parallelism
The link is: https://www.youtube.com/watch?v=IQxKjGEVteI

In my channel archery, I spend a lot of time making quality videos, tutorials, complete roadmaps all for free such as this:

https://www.youtube.com/watch?v=CBIu6hcyStg (5 hour backend roadmap)

If you can sub and like, it will help me a lot.
Thanks!


r/PythonLearning • • 11h ago

Claude making minecraft

0 Upvotes

So i coded a minecraft based game :https://github.com/NovaBlitz750/Nova_python/blob/main/Survival%20island%20game/survival_island_cdebugged.py after learnign python for abt t months and it turned out pretty well. I let claude go wild with it and turned out making minecraft and claude's version is rlly good. Hers the link for claude's version https://github.com/NovaBlitz750/Nova_python/blob/main/Survival%20island%20game/survival_island_claude.py


r/PythonLearning • • 13h ago

Help Request Auto-complete for SQLAlchemy isn't working in VS Code

2 Upvotes

r/PythonLearning • • 14h ago

Help Request Learning python as a beginner

3 Upvotes

I'm a bachelor student from a non-tech background.. and I want to learn python/coding from scratch.. but everything seems so overwhelming😭

  1. How can I learn python from scratch like completely as a beginner?

  2. Can someone suggest some resources where things don't seem overwhelming as a beginner?

  3. How long can it take for me to learn python and build some good projects?


r/PythonLearning • • 16h ago

Help Request How can I learn Python?

15 Upvotes

Hey, I'm new to programming and I wanna learn Python, I've learnt some of the basics but I'm kind of stuck. I was wondering if anyone had any suggestions to learn Python like courses, websites, etc.


r/PythonLearning • • 17h ago

Where can I study Data Analysis in Colombia-Bogotá

4 Upvotes

I'm studying on my own, but I've reached a point where I really need help 😵


r/PythonLearning • • 17h ago

Help Request GTK apps

1 Upvotes

I'm looking to learn more how to build GTK applications mostly for Fedora using python, I've been doing the CS50P course but also looking for some more learning material any suggestions will be helpful


r/PythonLearning • • 22h ago

Get and setter in pyhton

1 Upvotes

I'm learning Python, and this part has left me a little confused, because in other languages the way it's used is different; in Python you use @property, I'd like to understand how this really works in a simplified way, so I can truly grasp it and not just memorize it. If you could help me, I'm still new to programming.


r/PythonLearning • • 1d ago

Help Request are there anyway to reject a string entry if it already existed inside the txt file?

4 Upvotes
def add_product():
    new_product = name_entry.get()
    with open("list of products.txt", "a") as file:
        new_product_name = name_entry.get()
        new_product_ID = id_entry.get()
        new_product_category = category_entry.get()
        new_product_price = price_entry.get()
        new_product_quantity = quantity_entry.get()
        new_product_expiry = expiry_entry.get()
        messagebox.askokcancel(title="submit a new product?", message="Submit a new product?")
        file.write(f"{new_product_name}, {new_product_ID}, {new_product_category}, {new_product_price}, {new_product_quantity}, {new_product_expiry}\n")
        name_entry.delete(0, END)
        id_entry.delete(0, END)
        category_entry.delete(0, END)
        price_entry.delete(0, END)
        quantity_entry.delete(0, END)
        expiry_entry.delete(0, END)

Hi guys, are there anyway to refuse an entry that has already existed inside the file? for example if biscuit is already inside the txt file, I entered it again and it will refuse it and not add it to the txt file.


r/PythonLearning • • 1d ago

Help Request Best Python Course for Economics Students (Beginner to Advanced)?

6 Upvotes

Hey everyone!

I really wanna get into Python but I'm starting from absolute zero rn 😭 I want to learn it properly from scratch and eventually get to an advanced level.

I'm interested in using Python for Economics and also wanna explore Statistics and Data Analysis with it.

Would love some recommendations on:

  1. Good YouTube channels or playlists that teach Python from absolute basics to advanced.

  2. Any paid courses that are actually worth spending money on.

  3. Courses that teach practical applications of Python in Economics and Data Analysis.

  4. Any other skills or libraries I should learn alongside Python.

Also if anyone here is good at Python and wouldn't mind helping a beginner out feel free to DM me!!

Drop your suggestions and personal experiences. Would really appreciate it. Thanks!!


r/PythonLearning • • 1d ago

Beginner needing help with StoryBot/Storyboard and OpenMontage – Stuck setting up AI video production

2 Upvotes

Hello everyone!

I'm looking for someone experienced with Python, AI video generation, automation, and OpenMontage who can guide me through a project I'm building.

I'm a complete beginner with very little programming knowledge. Most of my setup has been done by following instructions from ChatGPT and Gemini, copying commands into PowerShell, and troubleshooting errors. I've managed to install quite a lot, but I'm struggling to put everything together and actually produce videos.

I would really appreciate patient, step-by-step guidance.

  1. StoryBot / Storyboard

My first project is an automated storytelling video system for YouTube Shorts, Instagram Reels, TikTok, and Facebook Reels.

What I've installed and configured:

\- Ollama with Qwen3:4b for local story generation.

\- Node.js, npm and n8n (installed locally, not Docker).

\- Python 3.11.9 and FFmpeg 9.0.2.

\- Parody TTS for narration.

\- Custom Python scripts.

My n8n workflow currently works up to this stage:

  1. I press Execute.

  2. Python scripts generate a story.

  3. A temporary "story.txt" file is saved.

  4. Narration is generated in parallel.

  5. The narration is saved in the output folder.

So story generation and narration are working.

ComfyUI experiment:

I also installed ComfyUI at:

"D:\\StoryBot\\ComfyUI-Install\\ComfyUI_windows_portable"

I downloaded two model files:

\- "flat2DAnimerge_v45Sharp.safetensors" (approximately 2.13 GB) – Stable Diffusion 1.5 checkpoint for 2D cartoon-style images.

\- "mm_sd_v15_v2.ckpt" (approximately 1.82 GB) – AnimateDiff motion module.

I wanted to generate and animate cartoon-style characters, but my GTX 1660 with 6 GB VRAM struggled with the workload. Generation was taking too long, so I couldn't get the results I wanted.

I currently have one male and one female presenter character as basic static images.

2. OpenMontage (Separate Project)

After getting frustrated with my Storyboard setup, I decided to try OpenMontage as a completely separate alternative.

I'm NOT trying to connect OpenMontage with StoryBot/Storyboard.

Repository: https://github.com/OpenMontageInc/OpenMontage

Installed/configured:

\- Python 3.11.9 virtual environment.

\- Node.js v24.22.1 and npm 11.19.1.

\- FFmpeg 9.0.2 and Git 2.56.0.

\- Remotion dependencies.

\- esbuild 0.28.1.

\- HyperFrames 0.9.39.

\- Piper TTS 1.8.0.

\- pytest 9.2.0.

\- ".env" configured from ".env.example".

I successfully ran:

"python scripts/backlot_simulate_run.py"

It generated a demo production with scenes sc1–sc4.

I can also access the Backlot interface:

"http://127.0.0.1:4750/p/backlot-demo-run"

However, I'm stuck on what to do next and how to move from the simulation to an actual rendered video.

3. My desired video appearance

\- Word-by-word animated subtitles.

\- Currently spoken word highlighted in blue.

\- Remaining words in white.

\- Purple/red gradient backgrounds.

\- Two consistent presenter characters.

4. My PC specifications

\- Windows 11 Pro.

\- AMD Ryzen 5 5600.

\- NVIDIA GTX 1660 Gaming X (6 GB VRAM).

\- 16 GB RAM.

I prefer free and open-source tools and want to run as much as possible locally.

5. What I need help with

StoryBot / Storyboard:

\- How do I complete the existing workflow and produce videos?

\- How should I use my presenter images?

\- Are there lighter alternatives to ComfyUI/AnimateDiff that work on my GPU?

OpenMontage:

\- How do I use Backlot properly?

\- What are the next steps after a successful simulation?

\- How do I produce an actual video?

I'm not trying to combine these two projects. I want to understand them separately.

6. How I would like to be guided

Please understand that I'm genuinely new to programming.

I would appreciate someone who can:

\- Start from my existing installations.

\- Give me one step at a time.

\- Provide exact commands and tell me where to run them.

\- Explain what each step does.

\- Wait for my results before moving forward.

\- Help me troubleshoot errors.

I've spent a lot of time getting this far, and I don't want to break my existing setup by randomly changing things.

If anyone has experience with OpenMontage, Remotion, ComfyUI, Python automation, or AI video production, I'd really appreciate some guidance.

Thank you for reading!


r/PythonLearning • • 1d ago

Python Booleans #coding #python #learnpython #programming

Thumbnail
youtube.com
2 Upvotes

r/PythonLearning • • 1d ago

Computer Science Simplified - Threads and Processes Python Guide

6 Upvotes

Hey everyone, Just made a video which explains about threads and processes and shows how to use them in python!

I make quality videos which simplify complex things, If you can sub and like (and maybe add a comment)
It will help me create more guides for free!
The link is: https://www.youtube.com/watch?v=-Nntexhs124


r/PythonLearning • • 2d ago

Help Request Python Resources

2 Upvotes

Had a midterm exam and I'm quite sure I bombed it. I know Python, but not enough to be prepared for the questions I was asked. What resources could teach me python like I'm preparing for an interview, if that makes sense? I feel like that is the style of questioning my professor used and I really want to be ahead of the curve next time.


r/PythonLearning • • 2d ago

built a full multi-user CRM using zero third-party dependencies, thoughts?

0 Upvotes

I challenged myself to build a production-ready, multi-user CRM for small agencies using strictly the Python 3.9+ standard library; zero pip packages, zero frameworks, and zero frontend build steps.

49 Second Walkthrough: https://www.loom.com/share/ee9b8507bf6c4811b6f2b6b267e90547

A few interesting standard-library implementation details:

Auth & Security: Password hashing with hashlib.scrypt + per-user random salts and hmac.compare_digest, account lockout after failed attempts, and RFC-compliant TOTP 2FA + backup codes written with hmac, struct, and time.

Database Layer: Raw sqlite3 running in WAL mode with foreign keys enforced, integer-cent currency storage (value_cents) using decimal.Decimal to avoid float rounding bugs, automated schema migrations via PRAGMA table_info, and a 200-row audit trail.

CRM Features: Multi-pipeline Kanban boards, stage-duration tracking (stage_at) to flag stale deals, duplicate contact merging, CSV import/export, role/field-level visibility masking (HIDEABLE fields), outbound webhooks, and automated daily .db backups.

Would love feedback from other Python devs on what else you'd expect in a zero-dependency internal tool!

Thank you ahead, for your time!


r/PythonLearning • • 2d ago

Discussion I want to ask something

8 Upvotes

U know i am learning python the basic parts are clear but in case of the libraries i usually am only learning those which are helpful for ml/AI integration but i usually come across various projects of people making innovative and creative projects using random libraries....my question is that while making a project how do you know it will be the one to be used as there are thousands if not millions of libraries so how out of those many libraries can u determine which one you will study and use? A really bugging question i had while shitting on 2 Am on my toilet really confusing


r/PythonLearning • • 2d ago

Help Request Kinda stupid question, how would I allow my calculator to take multiple inputs at once?

Post image
4 Upvotes

So I'm trying to make a calculator on my own, and it WORKS, but I dont really like having to type everything in seperately like this, and i'd rather just type my entire sum into one line, but for the life of me I cannot figure out how I would do that. If I explained this badly just lmk and I'll try to explain it better, thanks to anyone who can help :))


r/PythonLearning • • 2d ago

Help Request Can't remove specific text in txt file.

1 Upvotes
rom tkinter import *


def add_product():
    new_product = name_entry.get()
    with open("list of products.txt", "a") as file:
        new_product_name = name_entry.get()
        new_product_ID = id_entry.get()
        new_product_category = category_entry.get()
        new_product_price = price_entry.get()
        new_product_quantity = quantity_entry.get()
        new_product_expiry = expiry_entry.get()
        file.write(f"{new_product_name}\n")
        name_entry.delete(0, END)
        id_entry.delete(0, END)
        category_entry.delete(0, END)
        price_entry.delete(0, END)
        quantity_entry.delete(0, END)
        expiry_entry.delete(0, END)


def remove_product():
    name_data = name_entry.get()
    id_data = id_entry.get()
    category_data = category_entry.get()
    price_data = price_entry.get()
    quantity_data = quantity_entry.get()
    expiry_data = expiry_entry.get()
    with open("list of products.txt", "r") as file:
        products = file.readlines()
    with open("list of products.txt", "w") as file:
        for line in products:
            print(line)
            name = line
            if name != name_data.strip():
                file.write(name)

everytime i try to enter a product "apple" to delete, it will never be deleted from the "list of products.txt"

this is what is included inside products.exe:
apple
pear
pineapple