r/PythonLearning • • Jul 14 '26

Reviews on this

0 Upvotes

If anyone done this udemy course, how is it??
Or normal yt courses like bro code, fcc, etc are better?


r/PythonLearning • • May 11 '26

BNP-MAT

0 Upvotes
import sys
from PySide6.QtUiTools import QUiLoader
from PySide6.QtWidgets import QApplication, QMessageBox
from PySide6.QtCore import QFile, QIODevice
from PySide6.QtGui import QPixmap
import urllib.request, json 
import qrcode
from datetime import datetime



def buttonClick():
    if len(window.lineEdit.text()) == 0:
        QMessageBox.warning(window, "Error", "Your own text")
        return
    
    if len(window.lineEdit_2.text()) == 0:
        QMessageBox.warning(window, "Error", "Your own text")
        return
    
    if len(window.lineEdit_3.text()) == 0:
        QMessageBox.warning(window, "Error", "Your own text")
        return


    


    try:
        data = {
            "date": datetime.now().strftime("%Y-%m-%d %H:%M"), 
            "box": window.comboBox.currentText(),
            "name": window.lineEdit.text(),
            "surname": window.lineEdit_2.text(),
            "adress": window.lineEdit_3.text(),
            "name_2": window.lineEdit_4.text(),
            "town_CSP": window.lineEdit_5.text()
        }
        qr = qrcode.make(json.dumps(data, ensure_ascii=False))
        qr.save("qr.png")


        window.label.setPixmap(QPixmap("qr.png"))
    
        
    except Exception as e:
        QMessageBox.warning(window, "Error")
        



       
if __name__ == "__main__":
    app = QApplication(sys.argv)


    ui_file_name = "mycode.ui"
    ui_file = QFile(ui_file_name)
    if not ui_file.open(QIODevice.ReadOnly):
        print(f"Cannot open {ui_file_name}: {ui_file.errorString()}")
        sys.exit(-1)
    loader = QUiLoader()
    window = loader.load(ui_file)
    ui_file.close()
    if not window:
        print(loader.errorString())
        sys.exit(-1)
    window.show()
    



    # how to get json from url (webpage)
    with urllib.request.urlopen("URL") as url:
        data = json.loads(url.read().decode())
    



   
    for key, name in data.items():
        window.comboBox.addItem(name, key)


    


    window.pushButton.clicked.connect(buttonClick)
    #name= window.lineEdit
    #surname= window.lineEdit_2
    #adress= window.lineEdit_3
    #name_2= window.lineEdit_4
            
    sys.exit(app.exec())
    

r/PythonLearning • • Apr 19 '26

Struggling with FunctionGemma-270m Fine-Tuning: Model "hallucinating" and not following custom router logic (Unsloth/GGUF)

Post image
0 Upvotes

Hey everyone,

I'm working on a project that uses FunctionGemma-270m-it as a lightweight local router. The goal is simple: determine if a user wants the time, the date, to enter sleep mode, or just needs general chat (NONE).

I am using Unsloth for the fine-tuning on Google Colab and exporting to GGUF (Q8_0) for offline use. Despite running 450 steps with a synthetic dataset of 500 examples, the model seems to be "fighting" the training. Instead of clean tool calls, I get hallucinations (like "0.5 hours" or random text).

After deep-diving into theofficial Google docs, I realized my formatting was off. I've updated my scripts to include the official control tokens (<start_function_call>, <start_function_declaration>, etc.) and the developer role, but I'm still not seeing the "snappy" performance I expected.

Has anyone successfully fine-tuned the 270M version for routing? Am I missing a specific hyperparameter for such a small model?Here are the relevent codes that i used,please check it out:https://github.com/Atty3333/LLM-Trainer


r/PythonLearning • • Oct 17 '26

Discussion Beginners in Python automation freelancing — what should I focus on first?

0 Upvotes

Hi everyone!

I'm a beginner learning Python automation using Pandas and OpenPyXL, and I want to start freelancing.

I've built a CSV Cleaning & Sales Reporting Automation project that cleans data, handles missing values and duplicates, and generates formatted Excel reports.

I'm still confused about how to take the next step. I'd love advice from people who have experience in Python automation freelancing.

  • What skills should I focus on first?

  • How did you find your first client?

  • What kind of small automation tasks should a beginner start with?

  • What mistakes should I avoid when starting out?

I'm not looking for shortcuts. I want to learn the right things and build my skills while getting started.

I'd really appreciate any advice. Thank you!


r/PythonLearning • • Jun 23 '26

Showcase librarian-press: config-driven pretraining and SFT framework for GPT-style SLMs with resume-safe manifests, DDP, and Prometheus metrics [PyPi]

0 Upvotes

Been building my own SLM family (the Librarian series) for a while, pretrained and SFT-tuned from scratch. The training infrastructure I built for that is now a standalone open source framework called librarian-press, published on PyPI today.

pip install librarian-press

WHAT IT DOES

You bring cleaned Parquet or .txt files and one JSON config. It handles the full pipeline end to end:

Tokenizer training (BPE, ByteLevel, NFKC normalization)

Tokenization + sequence packing into uint16 .bin shards

Pretraining with GPT architecture: RoPE, RMSNorm, SwiGLU MLP, weight tying

SFT with LoRA, BitFit, or full fine-tune and completion-only masked loss

Evaluation: perplexity, exact match, token F1

Export to a portable self-contained bundle + Ollama-style chat REPL

ENGINEERING DECISIONS WORTH KNOWING

Resume-safe pipeline. Every data stage (ingest, tokenize, pack, prepare) is shard-tracked with atomic manifests. Each shard goes pending > processing > verified > done. Crash or spot preemption at any point, re-run the command and it picks up from the last completed shard. Not the last epoch. The last shard.

Multi-GPU DDP. One torchrun command parallelizes across GPUs. Gradients all-reduce at the accumulation boundary. Data stages and eval run on rank 0 only. Single-GPU path is completely unchanged, no flags, no config switches.

Production observability. --metrics-port exposes a Prometheus-compatible /metrics endpoint with zero extra dependencies, no prometheus_client required. Tracks train loss, val loss, LR, grad norm, tokens/sec, GPU memory bytes, inference latency, and generated tokens/sec. Scrapable by Grafana live.

Method-aware checkpointing. Full pretrain saves full state dict. LoRA saves adapter weights only. SFT verifies tokenizer SHA against the base checkpoint before training so you never silently fine-tune on a mismatched vocabulary.

THE $100 CLAIM

I cross-checked this on actual published GPU rates as of June 2026:

GCP a2-highgpu-1g: $3.67/hr

AWS p4d per GPU: ~$4.10/hr

Azure single A100: ~$3.67/hr

360M params on-demand: ~$22

700M params on-demand: ~$48

1B+ params on spot instances (60-70% discount): under $100

The resume-safe pipeline is what makes spot viable. Without shard-level resume, spot preemption kills your run and you restart from zero. That is the engineering that makes the cost claim real.

Target range is 100M to a few billion parameters. Not trying to compete with Megatron or FSDP territory. This is for researchers and builders who want to own a domain-specific model without stitching together a training stack from scratch.

GitHub: github.com/sujal-maheshwari2004/librarian-press

PyPI: pypi.org/project/librarian-press

Happy to answer questions on the architecture or any of the design decisions.


r/PythonLearning • • Sep 29 '25

Help Request What does invalid Syntax mean in this case?

Post image
32 Upvotes

The game is pretty simple. Bubbles spawn randomly, move around the screen and you have to collect them to gain score points. The code is from a 11 year old german book. Im pretty sure i did everything as it was written down but the order was pretty weird because it told me to code the definitions in a strange order just to change the order later. At this point its also the first time that i dont 100% understand what im actually coding.


r/PythonLearning • • Oct 15 '25

A simple programme for converting currency

Post image
74 Upvotes

I have written this program by sitting at night, I had made this program very logically, my output would have been like this, but I am making a mistake that if I am giving an integer value then that value is getting printed multiple times, I am not able to understand, I am new to python, I have just started learning python


r/PythonLearning • • Jun 20 '26

Which IDE to use for Python

9 Upvotes

I am new to python i don't know which IDE to use. My university is teaching a course Programming for AI. I got to know they will teach python but idk which IDE.


r/PythonLearning • • Apr 03 '26

Is web scraping with Python still worth it in 2026 for freelancers (especially on Fiverr)?

9 Upvotes

Hi everyone,

I’ve been learning web scraping using Python (BeautifulSoup, Selenium), and I’m thinking about offering it as a freelance service on platforms like Fiverr.

My question is: is web scraping still worth it in 2026 for freelancers?

With more websites using anti-bot protection and offering official APIs, I’m wondering:

  • Is there still demand for scraping gigs on Fiverr or similar platforms?

  • Can beginners realistically make money from it today?

  • What kind of scraping services are still in demand?

Would really appreciate insights from people who are freelancing or have tried selling scraping services recently. Thanks!


r/PythonLearning • • Mar 27 '26

Discussion Learning python from scratch

9 Upvotes

Never felt more alive feeding my curiosity about programming language. Thanks to AI as my guide and teacher


r/PythonLearning • • Aug 27 '24

WHY DONT WORK

Post image
3 Upvotes

day five trying to learn python still dont understand why this code isnt returning the text, like “Insira o numero da sua respectiva classe: 3” 3- Paladino

Why is only showing 3? :(


r/PythonLearning • • May 11 '26

No dependences! A library for speeding up and controlling Python itself 🚀!

3 Upvotes

🚀 PyPUtil: The Ultimate Python Package & Module Utility Library

👋 Meet the Creator Hi! I'm Moamen Walid from Iraq. I spent two years writing code to build my library called "PyPUtil" (short for Python Package Utilities). It's a general-purpose library for Python, but very specific to packages and modules. Anything you need related to packages and modules is available in this amazing library!

⚡ Key Feature: PyPUtil CUtil The main feature of this library is "PyPUtil CUtil" — a set of tools for controlling and speeding up Python by writing direct C/C++ code within specific functions, which it then builds in Runtime!

💡 Basic Example with cfast:

from pyputil.cutil import cfast
add = cfast.cfunc("int add(int a, int b) { return a + b; }")
print(add(10, 5))  # Output: 15 — all in Runtime!

🧠 The Main Character: cimporter

from pyputil.cutil import cimporter

# Load a C module
module = cimporter.load("my_extension.c")
result = module.my_function(42)

# Load with optimizations
module = cimporter.load(
    "neural_net.cpp",
    optimization="speed",
    simd="avx2",
    openmp=True,
)

# Load Cython module
module = cimporter.load_cython("fast_module.pyx")

# Batch loading
modules = cimporter.load_batch(["kernel.c", "utils.c", "math.c"])

Yes! All of this happens in RUNTIME!

🧪 Built-in Testing Framework Don't want to write test code? No problem! PyPUtil has a complete experiments framework built right in.

from pyputil.test import difftime
numpy, pandas, comparison = difftime("numpy", "pandas")
print(comparison.summary)

from pyputil.test import patch_module_case
patch_module_case("requests")
import requests
response = requests.gEt("https://api.example.com")

from pyputil.test import run_test_module
result = run_test_module("my_package", framework="pytest")
print(result.summary)

📦 Installation Just one simple command — no towering names!

pip install pyputil

📋 Important Notes • Current version: Beta 0.1.0 • License: MIT • If you encounter any mistakes, please don't blame me — help me improve by reporting issues at: https://github.com/moamen-walid-pyputil/pyputil/issues

📧 Contact • Name: Moamen Walid • Country: Iraq • Email: [email protected] • License: MIT


Everything you need for packages and modules is right here. Happy coding! 🎉


r/PythonLearning • • Jun 16 '26

Discussion Hey guys! I am Arnav. I am 14 and this is my 15th py project which is Advance Stone paper scissors which uses Markov chain style prediction to predict your next move. Follow this link to see my code:

Thumbnail
github.com
3 Upvotes

r/PythonLearning • • 1d ago

Engineers out here ! I need your help

3 Upvotes

I am a first-year Mechanical Engineering student looking to start learning Python from scratch. I don't want to get stuck in with endless tutorials on Youtube -

What I need is a clear direction geared specifically toward Mechanical Engineering applications.

Specifically, I’d appreciate your advice on:

  1. Core Applications & Tasks: Where is Python actually used in Mechanical Engineering?

  2. Essential Libraries & Software: Beyond basic Python, which libraries and external engineering software integrate well with Python, and in what order should I learn them?

  3. Learning Roadmap: What is the best method to go from zero programming experience to solving real engineering problems? Should I start by automating my first-year math/physics assignments, or follow a specific course/book?

  4. Beginner Projects: What are some practical, beginner-friendly project ideas tailored to a MechE fresher ?

Any roadmaps or advice on what you wish you had learned as a fresher would be hugely appreciated. Thanks in advance!


r/PythonLearning • • Oct 18 '25

Usless python bacis for new

0 Upvotes

I'm looking to learn python basics, but I don't want to learn all the extra things that are going hinder me in my growth. Not looking to get infor from LLMS. Looking for experienced learners. Topic some about on a podcast recently.


r/PythonLearning • • Oct 07 '25

Idea

0 Upvotes

Does anyone have the idea how to become a cricket analyst


r/PythonLearning • • Jun 08 '26

Dictionary in python basic problem

Thumbnail
gallery
0 Upvotes

Guys as I said I am learning python and now iam doing it from an app called learn python and ai,

So I came across this dictionary program the image with I have attached in that app , I typed it out in pycharm but its showing error what is the probable mistake I have done and guys please explain me a bit about dictionaries and this program and all


r/PythonLearning • • Jul 03 '26

Hi, could you please help me figure out why I'm getting this message? My camera light turns on and just stays on.

Thumbnail
gallery
3 Upvotes

r/PythonLearning • • 12d ago

Discussion PYTHON 🆚 ALL

0 Upvotes

"If you want to learn programming, don’t start with Python; you should start with another language."

This advice seems ridiculous to me, even though I hear it everywhere. Can someone explain this advice to me... and are they right?


r/PythonLearning • • Jun 22 '25

Job

4 Upvotes

Hey guys 👋 I’m currently in my 4th year of Computer Engineering 💻. Unfortunately, I don’t really know any coding languages except a little bit of Python 🐍. My CGPA is 7.9 🎓 — do I still have a chance of getting placed in a good company? 🤔 Would really appreciate any advice or suggestions 🙏


r/PythonLearning • • Jul 22 '26

What programming term sounded much more complicated than it actually was when you first heard it?

0 Upvotes

When I started learning Python, I discovered that sometimes the vocabulary intimidated me more than the code itself.

My first language is Spanish, so learning programming also meant becoming familiar with English words, abbreviations and combinations that may seem completely obvious to experienced programmers but were not obvious to me as a beginner.

For example, concatenation sounded like an advanced operation. Then I learned that, in a simple case, it can mean joining strings together:

first_name = "Guido"

last_name = "van Rossum"

 

full_name = first_name + " " + last_name

print(full_name)

Another small discovery happened when I learned len(). At first, it was simply a Python function whose name I had to memorize. When I realized that len was short for length, the name suddenly explained exactly what the function did:

word = "Python"

print(len(word))

The same thing happened with elif. I initially saw it as another strange Python keyword. Later, I learned that it comes from else if, and its purpose immediately made more sense:

age = 15

 

if age >= 18:

print("Adult")

elif age >= 13:

print("Teenager")

else:

print("Child")

Other names are more direct once you know their English meaning. Functions such as min() and max() already give you a clue about what they return. enumerate() also became easier to remember when I connected it with the idea of numbering items while going through them:

names = ["Ana", "Luis", "Carlos"]

 

for number, name in enumerate(names, start=1):

print(number, name)

Indentation was another term that sounded more complicated than it was. It refers to the space at the beginning of a line, similar to indentation in ordinary writing. The important difference is that, in Python, it is not only decorative: it defines which lines belong to a block of code.

I am not saying that every programming concept is easy or that these short explanations cover everything. I am still learning myself. My point is that an unfamiliar word can sometimes create a bigger mental barrier than the basic idea behind it.

Now, whenever I encounter a new term, I ask:

  1. What does it mean in plain language?

  2. Does its name or abbreviation come from another word?

  3. What is the smallest example that demonstrates it?

  4. What problem does it help solve?

What programming term, keyword or function sounded much more complicated than it actually was when you first heard it? What explanation finally made it click for you?


r/PythonLearning • • Jul 06 '26

how to learn python?

0 Upvotes

i tried codedex which was nive but not free, code with harry se try kiya but i dont understand for replet works plss help😓🙏


r/PythonLearning • • May 17 '26

Help Request Is there any python certification program without any course work?

3 Upvotes

I am a university student(non cs) and have learned python. I didn't follow any one specific course. Just followed what ever I could search and find. I already know python well and already learning machine learning(this time from coursera).

But I feel the need to add a python certificate in my resume. So is there any python certification program without the course work since going through it will be a waste of time.

I've found one from hackerrank but i feel it's too basic for me.

And the pythoninstitute.org one is too expensive for me.

Any other suggestions?


r/PythonLearning • • 10d ago

Help Request Python

0 Upvotes

Hi.

MY PROBLEM: I'm terrible at building algorithms. I never know "WHAT TO WRİTE NEXT LİNE" when coding. im very bad at thinking how the algoritm works... need help. pls

--- Another issue : i haven't decided which field of Python I want to specialize in yet. So i dont know which tools or programs or technologies I should learn beside with python... and I feel like I'm wasting time trying to figure it all out, yeh i feel lost :(((

***I think the best thing to do is learn Python basics really well first, no matter which field we choose later***

Availability & Time Zone: Time zone: UTC+3. I'm working during the day so im available in the evenings/nights.

I also have a learning project idea. For example, we could use AI to create a simple website (like a dietitian's website or dentist whatever ) The frontend isn't our focus, so AI can handle that part. Then, we can focus on learning Python and backend by actually building the backend together. and learn the backend tools.. or data ? idk
For example, the website could have an "appointment form" with name, surname, phone number, email . We could learn how to handle all this data using Python.

I thought this could be a good way to practice. What do you think?

one last thing: rarely open Reddit, so I might miss your message here. If you're seriously interested u are allowed to quick dm me IG:tecna06 (my profile is a jersey).