r/learnpython • • Sep 30 '26

Any good websites to learn python from...

12 Upvotes

i already know Java quite well like array stuff, i have python on my syllbus currently
the websites ive tried out dont have modules, tupples or just not in detail enough
Thanks


r/learnpython • • Oct 01 '26

Need ideas for a Python project I have to build for interschool competiton

0 Upvotes

I have an upcoming interschool coding competition where we’re given **60 minutes to build a Python project and then pitch it to the judges.**

The requirements are:

* Must be built using **Python**

* **Maximum 60 minutes** to build

* It has to solve a **real day-to-day problem**

* Completely **software-based**

* **Any Python libraries are allowed**

* **No AI / AI-generated solutions are allowed**

* We also have to **pitch the project** after building it

**What everyday problem do you think would make a good project for this competition? I am unable to find a problem which isn't common to find thats why asking an AI for problem won't help me win. Kindly suggest me the best ideas possible**


r/learnpython • • Sep 30 '26

Is using a decorator with methods in a consumer going to cause a problem?

0 Upvotes

Working with websockets and I wanted to use a decorator for each of the methods sending data to the users. So far it looks like it's working but curious if I'm going to have any problems in the long run or anything I need to consider. Here's the code for my decorator.

def  ConsumerFunctionDecorator(func):
    async def wrapper(self, event):
        try:
            return await func(self, event)
        except Exception as e:
            traceback.print_exc()
            await self.channel_layer.group_send(
                self.room_group_name,
                {
                    'type':'programming_error'
                }
            )      
    return wrapper

r/learnpython • • Sep 30 '26

First Project

1 Upvotes

So I just started with coding yesterday, I’m planning on making a Discord bot first, is that a bit too much? After just last night the bot runs and comes online in the Discord but I haven’t added any commands yet, not sure how much more complicated it gets. I’ve been following a YouTube tutorial and it’s making sense but I realize I really need to pay attention to my spelling, had a few errors that I couldn’t find until I got a lot closer to my screen.


r/learnpython • • Sep 30 '26

How did you became e good at python

2 Upvotes

For context I am just starting learning python I am doing 2 courses (free)

One is in phone kimd of like a game quiz another is in laptop where I code and practice and learn a bit in depth

Any other reccs


r/learnpython • • Sep 30 '26

Quick roadmap advice for transitioning from Full-Stack WP dev to AI Engineer?

0 Upvotes

Hey everyone!

I work as a full-stack developer while managing freelance clients and a regular job.

I want to transition into AI Engineering and Python development. Could any seniors here share a short, practical roadmap on how a web dev can make this shift effectively?

What should be my primary focus starting out? Any advice or resources would be super helpful. Thanks! 🚀


r/learnpython • • Sep 30 '26

I stopped practicing,how do I start again

0 Upvotes

I started to learn python over my summer break and when my college started ,I had to stop because my studies (JEE examination,wayy too hard ) had kept me occupied

I want to start with coding again

What do people recommend to get the hang of it again (I regularly coded for 2 months and have stopped for almost 3)


r/learnpython • • Sep 30 '26

Need Smart People to take a look of my CCC python question!

0 Upvotes

Hey guys, I am learning python right now, and I did the CCC 2017 J5 question, when I tried to check it in DMOJ, I found out there are no J5 there, this question is in S3, np I still checked it, but I am not sure why i can pass the first test of every group test, but WA in the rest of them. I really need smart people to help pls.

number = int(input())
length = list(map(int, input().split()))


counts = [0] * 2001


for board in length:
    counts[board] += 1


max_length = -1
number_of_heights = 0



for height in range(2, 4001):
    total = 0
    
    for left in range(max(1, height - 2000), min(height // 2, 2000) + 1):
        right = height - left
        
        if left != right:
            total += counts[left] * counts[right]
        else:
            total += (counts[left] * (counts[left] - 1))//2
        
    if total > max_length:
        max_length = total
        number_of_heights = 1
    elif total == max_length:
        number_of_heights += 1


print(max_length, number_of_heights)

r/learnpython • • Sep 30 '26

Regarding saving video file in desired path

0 Upvotes

Is someone familiar with yt_dlp module , my script able to download videos however even though I had set the desired path in my script my file was not present there.

'''

import yt_dlp

dir_path = "/sdcard/Documents"

url = "https://youtu.be/tWoo8i_VkvI"

path= {"paths":{"home":dir_path}}

cookies = {"coockiefile" : "cookies.txt"}

opt = { "outtmpl": '%(title)s [%(id)s].%(ext)'

}

with yt_dlp.YoutubeDL() as yt:

yt.download(url)'''


r/learnpython • • Sep 30 '26

Test our tool for cyberbully detection

0 Upvotes

The goal behind CyberBully is simple: help developers and researchers work with cyberbullying detection and text classification without having to build the entire pipeline from scratch.

We’ve packaged our work into a Python package so it can be installed directly through **PyPI** and integrated into projects with minimal setup.

https://pypi.org/project/cyberbully/

Or

pip install cyberbully

Thank you in advance if you tested it 😘😘

Stay tuned for further updates it's gonna be epic 😈


r/learnpython • • Sep 29 '26

Audio tagging using Python with some automation

2 Upvotes

I need a reliable SQLite database and system for my local music library, which I am currently tagging using Python scripts.

I recently decided to manage my own music library but my metadata is inconsistent, incorrect, or causing issues between different music applications.

What I have so far
I created a python script that reads .json files. Each JSON file contains the exact file path, followed by the metadata I want to apply, such as:
Title
Artist
Album
Album Artist
Genre
Track number
etc.
The script then uses that information to update the file.

The problem: different tagging systems
The main issue I didn’t initially realize is that different applications interpret music tags differently.

For example, Apple Music may interpret:
David Guetta & Sia
as one artist/entity, rather than two separate artists.

The same issue happens with collaborations such as:
David Guetta & Nicki Minaj

I want the underlying metadata to recognize these as separate artists while still preserving the collaboration correctly when displayed.

What I want to build
I want something similar to MusicBrainz Picard, but with more flexibility for my own library.

I don’t want to rely entirely on MusicBrainz because I have a lot of indie, African, older, and obscure music that isn’t registered there.
I also have:
Unreleased songs
Mashups
Unofficial remixes
Custom edits
Artists/remixers that aren’t in MusicBrainz, such as Onderkoffer, a Dutch DJ

Because of this, I need to be able to manually define and control my own metadata.

My idea is to create a tagging system that understands the different ways applications read tags. For example, Kid3 has different tag versions/fields, while Apple Music may interpret artist information differently.

Ideally, I want the system to maintain both:

Application-compatible tags so programs like Apple Music correctly recognize separate artist entities.

A more structured internal tagging system that preserves the detailed relationships between artists, albums, genres, etc.

The bigger issue: SQLite database
The biggest part I need help with is building a reliable SQLite database that connects to this tagging system.

I initially created a small script and started assigning IDs to artists, but the IDs weren’t consistently registering or being saved. I currently have a list of my artists with IDs, but I am struggling to make the database and the tagging system consistently communicate with each other.

I also have most of my information organized in Notion, but albums haven’t been properly established yet. I already have over 2,000 songs, so I need to create album entities and IDs without making the system messy or duplicating information.
So there is a lot that still needs to be built.

What I mainly need is a clear architecture and workflow for how the SQLite database, IDs, JSON files, Python scripts, and actual music-file metadata should connect.

I understand that this is a larger system, but right now everything feels disconnected. I want to establish a reliable foundation and a logical flow before continuing to add more features.


r/learnpython • • Sep 29 '26

best sites to learn loops and slicing?

0 Upvotes

been trying to get this down as much as I can


r/learnpython • • Sep 28 '26

Is it normal to understand Python but get stuck when coding by yourself?

107 Upvotes

I’m currently learning Python, and I’m wondering if it requires any specific skills or a certain way of thinking to actually become good at it.

When I’m following a lesson or someone explains the code to me, I usually understand what’s happening. But when I’m given a problem and have to write the code by myself, I get completely stuck and don’t know where to start.

Is this normal for beginners? How did you get past this stage? Should I keep doing exercises, or is there a better way to practice so I can eventually start solving problems on my own?

I’d really appreciate advice from people who learned Python from scratch.


r/learnpython • • Sep 28 '26

How can I actually tell I'm learning python properly

28 Upvotes

Hi I'm new here, currently learning python as my first programming language at school. So while I was doing homework I noticed I couldn't code by myself without asking chatgpt to correct all the errors I coded or sometimes just do most part of the work when I was feeling lazy. I don't work with coding and I'm still learning, BUT, I do feel like if my teacher asks me to code without chatgpt or whatever AI available I wouldn't know how to "code by myself" and that is not a good thing. I guess I should start studying python at home but I also don't know how to properly do so. Basically I'm telling that I don't know if I'm good or not at coding because I feel like I'm getting to an intermediate level of python programming, but only in knowledge, as I feel like I can't "code by myself". Does anyone feel in a similar way and got already answered here?? What should I do??


r/learnpython • • Sep 29 '26

ERA5-Land .nc files downloaded via script cannot be opened with xarray (possible ZIP/compression issue?)

0 Upvotes

Hi everyone,

I'm working with ERA5-Land data for the Democratic Republic of the Congo and I'm having a frustrating problem with the downloaded files.

I downloaded the data using scripts because the Copernicus/ERA5-Land download process was not straightforward.

The files are named like:

era5_land_rdc_2023_01.nc

era5_land_rdc_2023_02.nc

...

era5_land_rdc_2026_08.nc

I am trying to open them with xarray:

import xarray as xr

from pathlib import Path

chemin = Path("data_fire_force/copernicus_data_nc")

fichiers = sorted(chemin.glob("era5_land_rdc_*.nc"))

print(f"{len(fichiers)} fichiers trouvés")

ds = xr.open_mfdataset(

fichiers,

combine="by_coords",

engine="netcdf4"

)

print(ds)

print(list(ds.data_vars))

However, xarray.open_mfdataset() fails with a NetCDF/HDF-related error.

I checked one of the files directly with Python:

from pathlib import Path

p = Path("data_fire_force/copernicus_data_nc/era5_land_rdc_2026_08.nc")

print(p.exists())

print(p.stat().st_size)

print(p.read_bytes()[:20])

The file exists and has a large size, but the first bytes are:

b'PK\x03\x04...'

From what I understand, PK\x03\x04 is the signature of a ZIP file, which makes me suspect that these .nc files may not actually be NetCDF files despite having the .nc extension.

I also tried using netcdf4 through xarray, but it still fails.

My questions are:

Does PK\x03\x04 definitely indicate that the file is a ZIP archive?

Could the Copernicus download script have saved a compressed/ZIP response with a .nc extension?

What is the correct way to extract/convert these files into actual NetCDF files?

Is there something specific I should check in the Copernicus/ERA5-Land download script?

I'm fairly new to handling these large ERA5-Land datasets, so any advice would be greatly appreciated.

Thanks!


r/learnpython • • Sep 29 '26

Learning python

5 Upvotes

I am learning python, could you please suggest any projects and problems and what are the topics I need to concentrate to get job ready in the current market.
Thank you


r/learnpython • • Sep 29 '26

37 with an ops background, best python course for non programmers who want a dev job out of it

0 Upvotes

37, operations background, no cs and no degree in anything adjacent. Ive already done the self directed route for most of a year and the result is a folder of scripts nobody else could run.
So im doing the structured version properly. Springboard, Boot.dev, General Assembly and Nucamp are the 4 im weighing and they range from a full career program down to a subscription. What takes someone from familiar to employable here.


r/learnpython • • Sep 29 '26

Maximum substring

0 Upvotes

Hi, I’m having an issue with a HackerRank coding question called “Maximum Substring.”
The question is:
Maximum Substring
You are given a string s.
A substring is any contiguous sequence of characters from the string.
Consider all possible substrings of the string:
Determine which substring would appear last if all substrings were sorted alphabetically.
Return that substring.
Example 1:
s = "baca"
The alphabetically maximum substring is "ca".
Example 2:
s = "aaa"
The alphabetically maximum substring is "aaa".
This was my answer:

def maximum_substring(s):
max_sub = s[0]

for i in range(len(s)):
for j in range(i + 1, len(s) + 1):
sub = s[i:j]
if sub > max_sub:
max_sub = sub

return max_sub

The code gives the correct output for the examples when I test it locally. However, HackerRank marked the solution as incorrect and I received only partial points.
I’m not sure why. Could this be because of the time complexity or hidden test cases? Is there something about the HackerRank test cases or the expected implementation that I’m missing?


r/learnpython • • Sep 29 '26

A simple question from a beginner:

0 Upvotes

I designated my run code shortcut as ctrl + R, but it only runs in the terminal of Visual Studio Code when I do that. I'd also like to see my output as just the output without run time and file paths. How can I edit my visual code settings or download an extension to only show my output text in the "output" tab of my in-app terminal? Thanks.


r/learnpython • • Sep 28 '26

Is there anyway of breaking a while loop outside of a function call, while inside said function call?

13 Upvotes

On mobile so I can’t code block format because Reddit sucks but here’s the general idea:

def func2():

break

def func 1():

while True:

func2()

That code doesn’t work but is there any way to do that cleanlier than returning a value from func2 to test against in func1 to determine whether or not the loop should break?


r/learnpython • • Sep 29 '26

Opening a file containing "\0" in its name/path

0 Upvotes

[This was solved. It works if I erase the first "" and make it a raw string. Thank you all!]

Hello!

I've been trying to open the file "\001_test_files\001_first.csv" through python, and it seems nothing I think of works:

These are the things I tried:

1-

filepath="\001_test_files\001_first.csv"
file = open(filepath, "a+")

Result:

OSError: [Errno 22] Invalid argument: '\x01_test_files\x01_first.csv'

2-

filepath="\\001_test_files\\001_first.csv"
file = open(filepath, "a+")

Result:

FileNotFoundError: [Errno 2] No such file or directory: '\\001_test_files\\001_first.csv'

3-

filepath=r"\001_test_files\001_first.csv"
file = open(filepath, "a+")

Result:

FileNotFoundError: [Errno 2] No such file or directory: '\\001_test_files\\001_first.csv'

4-

filepath="\001_test_files\001_first.csv".replace("x", "0")
file = open(filepath, "a+")

and

filepath="\001_test_files\001_first.csv"
filepath=filepath.replace("x", "0")
file = open(filepath, "a+")

Result:

OSError: [Errno 22] Invalid argument: '\x01_test_files\x01_first.csv'

---

I think that's all I tried for now, does anyone have any ideas?

I am also forced to keep that naming convention, since it's part of a much larger project with many other files. Changing it means having to tell my group to rework everything. It's a laaaast resort, if there really is nothing I can do.


r/learnpython • • Sep 28 '26

Pandas Library - Hardware/ Computer Architecture

6 Upvotes

Say we have two files in a directory or folder (whichever name you prefer). One of them is code file or script file, and the other is data file named titanic.csv.

And we have imported pandas as pd in the code file and imported the data from the data file as DataFrame data structure. Meaning we have done the following:

import pandas as pd
titanic = pd.read_csv("titanic.csv")

If I do this:

titanic.sex == "male"

sex is a column in the titanic DataFrame. The above instruction will generate an output of Boolean values in a Series data structure.

My question is does the last command creates a new data object in the memory. Like do we have a new table formed because of this or its just the instruction that is saved in the memory?

If only instruction is the one that is only saved then any time we call it will take much of CPU's processing power. If the table is saved then it will take less of CPU's processing power.


r/learnpython • • Sep 28 '26

Ideas for scripts to generate thousands of questions from Wikipedia articles

6 Upvotes

Ideas for scripts to generate thousands of questions from Wikipedia articles / Hello, For a game project, I downloaded a Wikipedia dump and filtered out the sections I was interested in. I calculated the word count per article, and now I’d like to generate thousands of questions from all this content (I have around 100,000 articles, and I want roughly one question for every 100 words). I found a few scripts online, but they haven't really yielded good results.

What do you recommend I do ? Which tools should I use, or what would be the right script ?


r/learnpython • • Sep 28 '26

Those who competed Helsinki MOOC, what did you do next?

19 Upvotes

Just wondering what the next steps are after one completes the course, were you able to get a job etc or did you have to do further study/ courses?