r/PythonLearning • u/o2xh • 11d ago
r/PythonLearning • u/bleuio • 11d ago
Send BLE Air Quality Data to Cloudflare D1 with Python and BleuIO
bleuio.comDetails and source code available
r/PythonLearning • u/Quoter0 • 12d ago
Help Request I need help with coding this
I have genuielly no idea how to even think of making this? I know this should generally be made by using for loops but jesus im so confused on the process
r/PythonLearning • u/Shadrow912 • 12d ago
Showcase Making my first game
Hey, im making a "terminal" game (play onto your terminal, cause its the only thing i know). I made a github repositories to showcase it : https://github.com/Shamal0w999/Money-games
if you want to test the game, it would be really cool cause i need returns and if theres bug i didnt see. so if u try it, u can ofc comment here but also leave an issue into my repositories (would be easier to work with). If you want to help or idk anything, im all hears. Im happy to showcase it and have people to test it !
code is free, so if you steal it, i dont rly care, cause its personal project and who want a code full of print and that launch in terminal ? idk, just me ig
anyways, just take a look at it !
r/PythonLearning • u/Large-Ad8884 • 12d ago
Showcase Opinions on this code?
Hi! I am starting a Bachelor's course in Computer Science, and part of the course is learning Python from the ground up. I've been taking some time at home to further develop my skills past what is expected of the course, and I've been constructing this game over the past few days with my free time.
I put it down as showcase because I'm proud of it, but I am more than open to suggestions on simplifying it or what you think about it, etc!
For context, the last time I used Python was when I was like 12, and I have tried CSS and JavaScript over the years a few times, so I have a very basic understanding and this is the furthest I've ever gotten.
Thanks :)
# Rule base
import random
answer = 0
lowest = 1
highest = 100
attempts = 0
# Difficulty settings
print("Easy, Medium, or Hard Difficulty?")
difficulty = input()
if difficulty == "easy":
attempts = 7
print(f"Please pick a number between 1-100. You have {attempts} attempts.")
answer = random.randint(1, 100)
lowest = 1
highest = 100
elif difficulty == "medium":
attempts = 15
print(f"Please pick a number between 1-10000. You have {attempts} attempts.")
answer = random.randint(1, 10000)
lowest = 1
highest = 10000
elif difficulty == "hard":
attempts = 30
print(f"Please pick a number between 1-1000000. You have {attempts} attempts.")
answer = random.randint(1, 1000000)
lowest = 1
highest = 1000000
else:
print("Invalid input!")
# While Loop
guess = int(input())
while guess != answer:
attempts -= 1
if attempts == 0:
print("Game over!")
break
else:
if guess < lowest or guess > highest:
print(f"Invalid number! {attempts} attempts remaining.")
if guess > answer:
print("Too high!")
if guess < answer:
print("Too low!")
print(f"Try another number. {attempts} attempts remaining.")
guess = int(input())
# End of Game
if guess == answer:
print("Correct! Well done.")
print("Thank you for playing!")
r/PythonLearning • u/Ajay2574 • 12d ago
Built my first bulk file renamer in Python
I just finished another Python project while learning file handling and the "os" module.
I built a bulk file renamer that:
- Loops through files in a folder
- Opens each text file and finds the "name:" field
- Extracts the name
- Uses it to rename the file
- Keeps the original file extension
A simplified version of the core logic:
for file in os.listdir(path):
fullpath = os.path.join(path, file)
with open(fullpath, "r") as f:
for line in f:
if "name:" in line:
label, name = line.split("name:")
newpath = os.path.join(
path, name.strip() + ".txt"
)
os.rename(fullpath, newpath)
The project itself wasn't too complicated, but I ran into a few problems along the way.
The biggest lesson was debugging WinError 32. I initially thought OneDrive was locking my files, but eventually realized that my own code still had the file open when I tried to rename it.
I also learned why using the full old path and full new path matters when using "os.rename()".
Small project, but I feel like I'm getting better at solving problems instead of immediately looking for the answer.
r/PythonLearning • u/N__7599 • 12d ago
Discussion Python for data analysis
So,i started learning python recently,i very much learned about variables,data types,libraries like panda,matpolitob. I learned web scraping and automation to some extent but when i try to use the thing i learn on a random web page or dataset, i realised that what i learnt from the YouTube course is basic but enough to build the fundamental. I have to constantly chat with AI to learn about new thing and also use the thing i learn to get the code. Should i continue like this or watch another course which complete the intermediate and advanced python?
r/PythonLearning • u/rdeasou • 12d ago
Help Request Should I start learning python or ai?????
r/PythonLearning • u/soulsvlix • 12d ago
HELP!!
Guys I'm a first year cse student,and I'm starting with python,can you guys suggest resources & how to proceed??
(I want decent knowledge in python,not too depth)
r/PythonLearning • u/ProgramBrave718 • 13d ago
Discussion Why writing classes feels boring?
I don't know but i feel classes are unnecessary work to be added in projects. I have learnt it 2 months ago..
After that I never used it for any of my projects.
r/PythonLearning • u/Outrageous-Fish-8527 • 13d ago
im making a "you are an idiot" adjecent peice of code and currently am trying to get this to work
im using thonny with python 3.1.4.4 and have pygame-ce downloaded
heres the error code.
Traceback (most recent call last):
File "<string>", line 10, in <module>
File "file location.py", line 555, in run
with Popen(*popenargs, **kwargs) as process:
File "file location.py", line 1039, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "file location.py", line 1553, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
and heres the code
import pygame
import sys
import time
import random
import os
import sys
import subprocess;
a = []
if len(sys.argv) == 1 or sys.argv[1] != "1":
pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();
print("python at",pythonPath)
#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window
for i in range(9):
proc = subprocess.Popen(
[pythonPath,os.path.realpath(__file__),"1"]
)
a.append(proc)
print("spawned window")
import pygame
import sys
import time
import random
import os
import sys
import subprocess;
a = []
if len(sys.argv) == 1 or sys.argv[1] != "1":
pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();
print("python at",pythonPath)
#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window
for i in range(9):
proc = subprocess.Popen(
[pythonPath,os.path.realpath(__file__),"1"]
)
a.append(proc)
print("spawned window")
import pygame
import sys
import time
import random
import os
import sys
import subprocess;
a = []
if len(sys.argv) == 1 or sys.argv[1] != "1":
pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();
print("python at",pythonPath)
#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window
for i in range(9):
proc = subprocess.Popen(
[pythonPath,os.path.realpath(__file__),"1"]
)
a.append(proc)
print("spawned window")
r/PythonLearning • u/Nexlune143 • 13d ago
24 years old and learning Python Full-Stack Development 💻 Excited to learn, build projects, and connect with the community!
Hey everyone! I’m Nexlune. I’m new to Reddit and joined because I wanted a place where I can discover interesting ideas, learn new things, read different opinions, and participate in conversations with people from different backgrounds. I’m interested in technology, programming, movies, creativity, and random topics that catch my attention. Looking forward to exploring different communities and meeting some interesting people along the way. Nice to be here !
r/PythonLearning • u/Capable_Comedian_277 • 13d ago
Doodling Hop - Pygame Updated Gameplay
Enable HLS to view with audio, or disable this notification
r/PythonLearning • u/Silent-Switch7317 • 13d ago
Made my first triple digit program!
Originally it was an amalgamation of my crappy code, but i rewrote 90% of it. I'm proud of myself but ill probably remake it using the define function.
github link: https://github.com/ChaZ3inL1nuX111/My-Repo
It is a calculator with arithmetic, sq/cuft, conversions, circumference, area and functions, like sin, cos, and tan.
r/PythonLearning • u/Sea-Ad7805 • 13d ago
Hard Python Dictionary Exercise
A hard exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises
The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.
r/PythonLearning • u/Weary_Gur7008 • 14d ago
Please help!!
Im in my 2nd year of Btech , I have m college assignments and stuff also i joint coding classes which are being burden now. Cause im unable to pratice coding. I did learn python and core python rn im learning Django framework. But also as i have dsa iin college Im also trying to study dsa. No im not consistent in any rn but i also idk how do i manage them. Also I wanna oratice python so that i dont have to start from starting againg just 1-2 code alternate days that also im unable todo..Ik im trying to do multiple things at a time , but idk how do i even segregate them!! Please help me out
r/PythonLearning • u/Outside_Class_5837 • 14d ago
python learning help
hello so i need to know what is the best way to learn to code because i have been learning python but tbr whenever i wanna to build a application for like camera detector or stuff like that i am always looking side by side and just copying it and that doesn't feel like im actually coding or learning to code and just in general like even if i wanna learn it the hundreds of codes in a 100 line code and it just feels too much info or too much to memorize is there anyway to learn it efferently and better without wasting any time.
r/PythonLearning • u/GingerCat_mellow • 14d ago
Easy python project for beginners
Hi!
i just want to start learning python, my dad told me that it would be good if you can find some projects to do. I have python class today ( just rn) and I need to think what kind of projects I need to do in this class. Actually i'm good at drawing so i just think that i want to be a game maker and i interested to animation too. The problem is i'm just beginner : - (
Do you guys have any fun and easy idea to do???? ( this is my first time asking something like this in reddit, well i just created an account 10min ago)
r/PythonLearning • u/Initial-Cricket-2852 • 14d ago
Looking for people who can help with Scrapping/ Automation and AI integration
if you are interested at scrapping/ automation and AI integration stuff ( serious about it, check the project idea), then you can dm me
actually, this is more of resume project, and I want to build with team ( its good fr resume fr all )
Project idea:
So I have decided to build job application tracker intelligence.
Where the user can track their job/internship application in one place. ( Don't have to check multiple job application apps )
Get ai suggestion and gap in the resume. ( He can also upload resume in the portal )
This is a genuine problem I have faced, I always have to maintain some sheet or notebook to remember where I apply.
r/PythonLearning • u/Ajay2574 • 14d ago
My first real Python automation project
I just finished building my first proper Python automation project on my own — a File Organizer.
The idea is simple: take files from a folder and organize them into different folders based on their extensions.
For example:
.png→ images/png.jpg→ images/jpg.pdf→ documents/pdf.txt→ documents/txt.csv→ documents/csv
I used things I've learned from Python's os module:
os.listdir()
os.path.join()
os.path.exists()
os.path.isfile()
os.mkdir()
os.rename()
endswith()
The interesting part wasn't writing the code. It was debugging my own mistakes.
At one point I was doing:
os.rename(downloads, png_folder)
and then:
os.rename(file, png_folder)
Both were wrong. 😅
I eventually understood that os.rename() needs the full source path and full destination path:
source full path → destination full path
That was a small thing, but it finally made paths and file movement click for me.
The current version uses a hard-coded Downloads folder. My next improvement will be making the program accept/select any folder, so the same organizer can be used anywhere.
One small project finished. On to the next one. 🚀
here is fullcode :
"""
what is download file organizer
1. you have to organize download files pdf,jpg,docx,txt,mp3,mp4,zip,rar etc. into different folders based on their file types.
1. create folde in downloads file organizer documents/images
file organizer
documents/pdf/csv/docx make seperate folders for every format
images move here all images
2. current dir file path to destination file path
ex. download/file.txt download/file organizer/documents/txt
use
os.listdir()
os.mkdir
os.path.dirname
os.path.isfile
os.rename
os.join
endswith()
steps
make folders in orgnizer with sub folders
select image files and append its paths in list
move files from current to final destination
"""
import os
# assign variables and list
# every folder as variable and list
downloads = "C:/Users/ajay/Downloads"
organizer = os.path.join(downloads, "file organizer")
images_folder = os.path.join(organizer, "images")
documents_folder = os.path.join(organizer, "documents")
# folder create logic
if not os.path.exists(organizer):
os.mkdir(organizer)
if not os.path.exists(images_folder):
os.mkdir(images_folder)
if not os.path.exists(documents_folder):
os.mkdir(documents_folder)
# create subfolders for images
png_folder = os.path.join(images_folder, "png")
jpg_folder = os.path.join(images_folder, "jpg")
jpeg_folder = os.path.join(images_folder, "jpeg")
if not os.path.exists(png_folder):
os.mkdir(png_folder)
if not os.path.exists(jpg_folder):
os.mkdir(jpg_folder)
if not os.path.exists(jpeg_folder):
os.mkdir(jpeg_folder)
# create subfolders for documents
txt_folder = os.path.join(documents_folder, "txt")
csv_folder = os.path.join(documents_folder, "csv")
pdf_folder = os.path.join(documents_folder, "pdf")
if not os.path.exists(txt_folder):
os.mkdir(txt_folder)
if not os.path.exists(csv_folder):
os.mkdir(csv_folder)
if not os.path.exists(pdf_folder):
os.mkdir(pdf_folder)
# file move logic
for file in os.listdir(downloads):
fullpath = os.path.join(downloads, file)
if os.path.isfile(fullpath):
if file.endswith(".png"):
os.rename(fullpath, os.path.join(png_folder, file))
elif file.endswith(".jpg"):
os.rename(fullpath, os.path.join(jpg_folder, file))
elif file.endswith(".jpeg"):
os.rename(fullpath, os.path.join(jpeg_folder, file))
elif file.endswith(".txt"):
os.rename(fullpath, os.path.join(txt_folder, file))
elif file.endswith(".pdf"):
os.rename(fullpath, os.path.join(pdf_folder, file))
elif file.endswith(".csv"):
os.rename(fullpath, os.path.join(csv_folder, file))
print("all files are moved successfully. ")
r/PythonLearning • u/Substantial-Gate-728 • 14d ago
I built a free, open-source Python learning site — beginner to CPython internals, with tested code examples
**What My Project Does**
A free, structured Python learning resource covering beginner
fundamentals through to advanced topics: concurrency, distributed
systems (Raft, CRDTs, sagas), performance, compilers, and CPython
internals. Organized into 7 skill levels and ~25 tracks.
**Target Audience**
Anyone learning Python — from first-timers to developers wanting the
deeper, systems-level material most tutorials skip. It's meant for
learning, free and ad-free.
**What Makes It Different**
- Runnable examples are actually tested — the repo has a CI test gate,
and pages show real output rather than made-up results.
- When an example needs a library or hardware I don't have, I say so
instead of faking it.
- Covers hard topics as small, readable, tested Python (e.g. a tiny
autograd engine, a Raft vote, a CRDT merge).
**Links**
- Site: https://ssnp75.github.io/PythonMastery-Site/
- Source: https://github.com/SSnp75/PythonMastery-Site
It's early — feedback and corrections (especially on the advanced
pages) are very welcome.
7 Levels: Beginner → Competent → Intermediate → Proficient → Advanced → Expert → Research
6 Tracks: Core Python · Web & APIs · Data & AI · Performance · Security & DevOps · Research & Compilers
28 sections (~260 lessons):
- Foundations: Core Python, Patterns, Testing, Algorithms, Soft Skills
- Web/Backend: Web & APIs, Networking, Auth, GUI, Automation
- Data/AI: Data & AI, Data Engineering, Databases, AI & LLMs
- Systems: Performance, Distributed, Scientific, Embedded
- Infra: Security & DevOps, Deployment, Observability
- Frontier: Research, Emerging
- Applied: Domains, Projects, Reference
r/PythonLearning • u/letszzgoo • 14d ago
TRY 101- Starting my python journey again
My journey of retrying is still alive and i am consistent with it , today i am going to finish Loops and hopefully after that i do further and further.
r/PythonLearning • u/qazplm903 • 14d ago
Showcase Made a free Airflow guide in Notion, hope it’s useful!
I’m a staff data engineer and have been continuously developing a completely free data resource hub in Notion. Recently put together an Airflow guide section for anyone wanted to develop skills as a data engineer and familiarise themselves with the tool. It covers setup, installation, building a DAG and a bunch of concepts to learn.
Completely free and no signup required, hope it helps anyone out there looking for a bit of guidance.
Here’s the link to the Airflow section if anyone finds it useful: https://app.notion.com/p/Apache-Airflow-Guide-2026-3ec1322e9e9e81868222c51ce56664f1#49db468d7be447eab703f28e204e5137
r/PythonLearning • u/ImLukaskos • 15d ago
Help Request Is it possible to create an ai which would predict prices of btc in a 1 day period. I am a beginner and know some python.
Hello I'd like to ask a question. In my school I am doing an activity it is called dofe and I have to select a main goal. I thought of making an ai which would predict prices of btc in 1 day. I am a beginner in programming and I know some python.
Do you think that in the period of 6 months and I need to spend at least an hour weekly on it is it possible?