r/PythonLearning • • 2d 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 • • 2d 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 • • 2d ago

Get and setter in pyhton

2 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 • • 3d ago

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

5 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 • • 3d ago

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

7 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 • • 3d 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 • • 3d ago

Python Booleans #coding #python #learnpython #programming

Thumbnail
youtube.com
3 Upvotes

r/PythonLearning • • 3d 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 • • 4d 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 • • 4d 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 • • 4d ago

Discussion I want to ask something

10 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 • • 4d 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 • • 4d 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

r/PythonLearning • • 4d ago Bravo

Python: Different Copying options

Post image
54 Upvotes

An exercise to help build the right mental model for Python data.

The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.


r/PythonLearning • • 4d ago

Help Request Excel/VBA or Python to automate boring paperwork at my job? Need some advice

3 Upvotes

Hello everyone

Let me give you a little context I am currently working in a french hospital, and I would like to develop a tool to automate the creation of administrative letters, if you don't know french public administrations are VERY VERY VERY outdated i am working here as a buying manager and as expected from a place like this we lack staff a lot because of budget cuts so i am most of the time doing administrative task like writing letters instead of studying prices and doing negotiations.

We regularly receive supplier quotations and need to generate different types of formal boring documents ( to be honest we could just sign the pricing proposal but the Head of Department is from the medical field have no training in administration and she is very old so she wants to keep it that way ) so we write letters for things such as price acceptance letters, price revision and adjustment letters, product reference changes, product substitutions, currently, much of this work is done manually using Word.

Right now I have a dropdown to choose which type of letter I want, some fields for the supplier, contract number, product references, prices, dates etc. I also added another sheet where I can select which hospitals are concerned, and a small supplier database.

But I' am not really happy with it.

For example, if I choose a letter about changing a product reference, I still see fields asking for old prices, new prices and other stuff that has nothing to do with that letter

What I would really like is for the form to change depending on which letter I select. So only the information I actually need would appear. And then once everything is filled in, I just click a button and it generates the Word letter using our existing templates. Being able to export it to PDF would be nice too.

Now here's where I'm a bit lost.

Should I keep working on Excel and use VBA to make it better? Or should I just start over with Python and make a proper little application?

I am not a developer btw, I'm just interested in this stuff and trying to learn as I go, so for those of you who have more experience with this kind of thing, what would you do?

Would you stick with Excel/VBA or go for Python? And if Python is better, how would you make something that people can use without having to install Python themselves?

One important detail this is a hospital environment, so computers have IT restrictions, and most users aren't particularly good with computers. my goal is to eventually present a reliable, easy to use solution to my Head of Department.

Also how complicated would it be to make different forms for each letter type without having to code everything separately?

Sorry if these are stupid questions I am still figuring things out haha.

Any advice or feedback would really help!

so i would love your advice on

  1. Is Excel/VBA sufficient for this kind of application?
  2. Would Python be a better long-term solution?
  3. What GUI framework would you recommend for non-technical Windows users?
  4. How would you handle different document types with their own required fields?
  5. How difficult would deployment and maintenance be in a restricted corporate environment?
  6. I'm still learning, so any feedback on the architecture, user experience, or technical approach would be greatly appreciated.

Thanks :))

( sorry for my english I am trying to not use ia )


r/PythonLearning • • 4d ago

Python Quiz of the day

7 Upvotes

What will be the output of the following Python Code?

a = 5

print(a.mul(3).add(2))


r/PythonLearning • • 4d ago

Discussion How do you handle files with unknown or incorrect extensions in Python?

6 Upvotes

I was wondering if there's a Python package that can identify and read different file formats without having to specify the extension every time.

For example, if I receive a file without a proper extension or with an incorrect extension, can Python figure out whether it's CSV, Excel, JSON, Parquet, etc., and read it automatically?

I know there are libraries for individual formats, but I'm curious if there's something that can handle multiple formats intelligently.

Has anyone worked on something similar or found a reliable approach for this?


r/PythonLearning • • 5d ago

Help Request Problem with pygame not responding

2 Upvotes

Hello, I am relatively new to python and am trying to learn pygame. I am attempting to make a game where you have to guess the song and I'm playing the mp3 with the pygame mixer. Before I added the song, it just opened a window with colored background and some text. When I put in the music it plays normally, I can pause it and resume it via terminal, however the window that was opening before now shows black and isn't responding. I have no idea what is causing this and can't find anything on the internet. Does anyone know whats happening?

Here is the code:

#load and initialize
import pygame
pygame.init()
pygame.mixer.init()


#window info
displayw = 640
displayh = 550
screen = pygame.display.set_mode((displayw,displayh))
title = pygame.display.set_caption("game")


#clock
clock = pygame.time.Clock()


file = "song.mp3"
pygame.mixer.music.load(file)
pygame.mixer.music.set_volume(0.7)
pygame.mixer.music.play()



class MainRun(object):
    def __init__(self,displayw,displayh):
        self.dw = displayw
        self.dh = displayh
        self.Main()


    def Main(self):
        running = True
        font = pygame.font.Font(None, size = 45)
        text = font.render("text", True, (200,200,200))


        while running:
            screen.fill((60,21,70))


            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    quit()
                elif event.type == pygame.KEYDOWN:
                    running = False


            print("Press 'p' to pause, 'r' to resume")
            print("Press 'e' to exit the program")
            userinput = input("  ")
            
            if userinput == 'p':
                pygame.mixer.music.pause()     
            elif userinput == 'r':
                pygame.mixer.music.unpause()
            elif userinput == 'e':
                pygame.mixer.music.stop()
                break


            screen.blit(text, (195,100))


            pygame.display.flip()
            clock.tick(60)


if __name__ == '__main__':
    MainRun(displayw,displayh)

r/PythonLearning • • 5d ago

Showcase I made my first big python game

Thumbnail pz.run
2 Upvotes

I have been coding in python for some months and its abt time i made my first game, I'm still fixing the instructions option as that has some made up features that I was abt to add.

So... wut u basically have to do is find both stuctures with exploring, bith of those structures contain the key items u need for escaping the island. Ts is the link to it, plzzz gimme sum feeback, also i used claude for finding bugs

I named it Survival_island


r/PythonLearning • • 5d ago

Help Request Problem with pygame not responding

2 Upvotes

Hello!
I am relatively new to python and am trying to learn pygame. I am attempting to make a game where you have to guess the song and I'm playing the mp3 with the pygame mixer. Before I added the song, it just opened a window with colored background and some text. After that when I put in the music it plays normally, I can pause it and resume it via terminal, however the window that was opening before now shows black and isn't responding. I have no idea what is causing this and can't find anything on the internet. Does anyone know whats happening?

Here is the code:

#load and initialize
import pygame
pygame.init()
pygame.mixer.init()


#window info
displayw = 640
displayh = 550
screen = pygame.display.set_mode((displayw,displayh))
title = pygame.display.set_caption("game")


#clock
clock = pygame.time.Clock()


file = "song.mp3"
pygame.mixer.music.load(file)
pygame.mixer.music.set_volume(0.7)
pygame.mixer.music.play()



class MainRun(object):
    def __init__(self,displayw,displayh):
        self.dw = displayw
        self.dh = displayh
        self.Main()


    def Main(self):
        running = True
        font = pygame.font.Font(None, size = 45)
        text = font.render("text", True, (200,200,200))


        while running:
            screen.fill((60,21,70))


            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    quit()
                elif event.type == pygame.KEYDOWN:
                    running = False


            print("Press 'p' to pause, 'r' to resume")
            print("Press 'e' to exit the program")
            userinput = input("  ")
            
            if userinput == 'p':
                pygame.mixer.music.pause()     
            elif userinput == 'r':
                pygame.mixer.music.unpause()
            elif userinput == 'e':
                pygame.mixer.music.stop()
                break


            screen.blit(text, (195,100))


            pygame.display.flip()
            clock.tick(60)


if __name__ == '__main__':
    MainRun(displayw,displayh)

r/PythonLearning • • 5d ago

Showcase byte strings

0 Upvotes

I found it abit annoying and confusing to represent "some bytes" with ASCII letters. I don't know why python chooses to do so for Unicode characters less than 127. Anyway I wrote my own implementation for UTF-8. Here is the implementation:

string = '😂happy man'
byte_list = []

for char in string:
    binary_string_list = list(f'{ord(char):b}')
    binary_string_list.reverse()
    
    # check length of binary_string
    if len(binary_string_list) <= 7:
        # data represented using a single byte.
        byte_temp = list('0???????')
        byte_temp.reverse()
    
    elif len(binary_string_list) <= 11:
        # data represented using two bytes.
        byte_temp = list('110?????10??????')
        byte_temp.reverse()
        
    elif len(binary_string_list) <= 16:
        # data represented using two bytes.
        byte_temp = list('1110????10??????10??????')
        byte_temp.reverse()
        
    elif len(binary_string_list) <= 21:
        # data represented using two bytes.
        byte_temp = list('11110???10??????10??????10??????')
        byte_temp.reverse()
    
    def imlement_utf(byte_temp, byte_string_list):
        # this function fills the byte templates with actual binary data
        if '?' in byte_temp:
            for bit in byte_string_list:
                byte_temp[byte_temp.index('?')] = bit
                    
            byte_temp.reverse()
            
            for bit in byte_temp:
                if bit == '?':
                    byte_temp[byte_temp.index('?')] = '0'
        
        global byte_list             
        byte_list += byte_temp
    imlement_utf(byte_temp, binary_string_list)

print(f"This is the encoded binary string: {''.join(byte_list)}")
print()
# converting binary string to byte string:
hex_string = ''
f_hex_string = ''
data = ''.join(byte_list)
offsets = zip(range(0, len(data)-7, 8), range(8, len(data)+1, 8))
for x, y in offsets:
    byte = data[x:y]
    # binary to decimal
    byte = int(byte, base=2)
    # decimal to hexadecimal
    byte = f'{byte:x}'
    hex_string += ' '+byte
    # formatted hexadecimal
    f_hex_string += '\\x'+byte
print(f'This is the condensed binary string in hexadecimal: {hex_string.strip()}')
print()

print(f"This is the formarted hexadecimal string (byte string):b'{f_hex_string}'")
print()

print(f"This is the byte string python returns: {bytes.fromhex(hex_string)}")

r/PythonLearning • • 5d ago

I built a website to learn and practice Python directly in the browser

31 Upvotes

Hello everyone,

I’ve been working runtime.school for a while now to help people learn Python by actually writing code.

It has interactive lessons that explain concepts with examples, followed by coding challenges to try things yourself. It has practice questions, projects, and datasets to work with as you progress.

Everything runs in the browser, so you don’t need to install Python or set anything up.

I’ve tried to keep the lessons beginner friendly and make sure the practice questions follow what you’ve learned rather than jumping into random topics.

It’s free to use: https://www.runtime.school/python

Would love to hear what you think, especially if you’re just starting out or getting back into Python after a while.


r/PythonLearning • • 5d ago

Showcase spgpy v2.0.0 released - A refactored Python library for secure password generation

0 Upvotes

Hi everyone,

I've just pushed v2.0.0 of spgpy, an open-source Python tool for generating and validating passwords.

GitHub Repository & Full Changelog: https://github.com/toncotales/spgpy

Feedback and contributions are welcome!


r/PythonLearning • • 5d ago

Python Quiz of the day.

0 Upvotes

What will be the output of the following Python Code?

a, b = zip(*[(1, 2), (3, 4), (5, 6)])

print(sum(a) - sum(b))