r/PythonLearning • u/Esaiasilence • 4d ago
r/PythonLearning • u/Correct_Ask_6824 • 4d ago
Help Request How to convert UTF-16 to UTF-8 in Macbook?
Hello, I wrote a code on my macbook that I have to transfer to a windows computer that is permanently offline. However, the windows computer python doesnt want to read the code because it has "null bytes" apparently it can't read UTF 16 only UTF 8. Is there a command I can run on my macbook terminal to change the .py file to UTF-8? Please let me know. Thank you!
r/PythonLearning • u/No-Gift5463 • 5d ago
Love SPYDER but Need AI
Love SPYDER because itβs easy to use for my basic yet copious Python work. But the AI assist in VS Code is amazing. Is there some new SPYDER with AI assist or some other alternative for consideration?
r/PythonLearning • u/Emergency_Evening616 • 5d ago
Help Request Beginner-friendly Python resources for someone transitioning from Psychology to Computational Neuroscience?
Hi everyone!
I'm a Psychology graduate currently considering pursuing a Master's degree in Computational Neuroscience. Coming from a non-computer science background, I realize that I need to build a solid foundation in programming, particularly Python, before diving deeper into the field.
I've been trying to find introductory resources and came across Neuromatch Academy's Computational Neuroscience course, including their introductory materials.
However, I've found that even though the course is intended for beginners, I still struggle quite a bit with the Python explanations and code structure. I often find myself having difficulty understanding what's happening in the code itself, rather than focusing on the computational neuroscience concepts being taught.
I'm wondering if there are other resources that might be more suitable for someone in my position.
Ideally, I'm looking for resources that:
1.Start from the absolute basics, assuming little to no prior programming experience.
2.Explain programming concepts and code structure slowly and intuitively, rather than jumping straight into complex examples.
3.Gradually introduce concepts that are relevant to computational neuroscience (e.g., NumPy, SciPy, data analysis, mathematical modeling, simulations, etc.).
Help me understand not just how to write code, but also why certain approaches are used.
I'm open to pretty much any format: YouTube tutorials, online courses, textbooks, interactive platforms, or even a recommended learning sequence.
For additional context, my academic background is in Psychology, and I have very little programming experience. I'm not necessarily looking to jump straight into computational neuroscience yet; I'd rather develop a comfortable understanding of Python first, while keeping my long-term goal in mind.
For those who came from a non-CS background, how did you approach learning programming before getting into computational neuroscience? Are there any resources or learning paths you'd particularly recommend?
I'd really appreciate any suggestions. Thanks!
r/PythonLearning • u/Sea-Ad7805 • 5d ago
Learning SQL with Python?
This πinteractive SQLite demonstration helps student understand relational databases.
The sqlite3 extension of π¦ππ¦π¨π«π²_π π«ππ©π‘ makes database content visible alongside Python's data structures. The demo shows how to:
Create tables with primary and foreign keys.
Model relationships between students, courses, and teachers.
Insert data and observe how the database changes.
Combine multiple tables using SQL JOIN operations.
Use parameterized queries.
The final query answers a seemingly simple question: Which teachers teach Alice, and for which courses? Answering this question involves joining five tables!
With π¦ππ¦π¨π«π²_π π«ππ©π‘, students can step through the Python program and inspect the database content at every step, directly in their browser, without installing anything.
See πother π¦ππ¦π¨π«π²_π π«ππ©π‘ visualizations.
r/PythonLearning • u/No_Safety_5957 • 5d ago
Check50, uhm what?

months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
]
def split(var):
if "/" in var:
splitted = var.split("/")
if splitted[0].isdecimal() == False:
#print("error in splitting")
return
elif "," in mdy_format:
splitted = var.split(" ")
try:
return splitted
except UnboundLocalError:
#print("unboundlocalerror")
return
def checkvalues(checkval):
day, year = checkval[1], checkval[2]
#print(day)
if checkval[0].isdigit():
month = int(checkval[0])
else:
try:
month = months.index(checkval[0]) + 1
except ValueError:
#print("valueerror")
return
if month > 12:
return
day = day.replace(",","")
#print(day)
try:
day = int(day)
year = int(year)
except ValueError:
return
if day > 31:
#print("moth longer error")
return
#print(f"{day:02}")
return f"{year}-{month:02}-{day:02}"
while True:
mdy_format = input("Date: ")
mdy_splitted = split(mdy_format)
#print(mdy_format)
#print(mdy_splitted)
#print(len(mdy_splitted))
#useless comment
#another useless comment
if not mdy_splitted or len(mdy_splitted) != 3 or checkvalues(mdy_splitted) is None:
#print("error here")
continue
print(checkvalues(mdy_splitted))
breakwhy does it return an error? After doing acheck it seems to return the correct answer.
Code above (ignore the comments)
r/PythonLearning • u/Nyxveil1546 • 5d ago
Help Request Need Python Project Source Code for a College Project
I'm a first-year CSE student, and we've been asked to build a Python project as part of our college assignment.
I'm a beginner in Python, so I'm looking for some project ideas along with their source code that I can refer to and learn from.
If anyone has GitHub repositories, project source codes, or useful resources, please share them. It would be a great help!
r/PythonLearning • u/clcodingupdates • 5d ago
Python Quiz of the Day.
What will be the output of the following Python Code?
a, *b, c = [2, 4, 6, 8, 10]
print(a + c + len(b))
r/PythonLearning • u/Sameer_kusunoor • 6d ago
The day of learning of python full stuck
The basic information πππ
r/PythonLearning • u/RegularBother614 • 7d ago
What do you guys think?
After watching a python full course video on YouTube by BroCode, I made a simple number guessing game in python!
Here's the link to the video: https://youtu.be/ix9cRaBkVe0?si=UiWmP6bm-9MG4B1p
After 12 gruesome hours watching the tutorial i decided to make this to test what I've learned.
What do you guys think?
r/PythonLearning • u/WiseDeer42663 • 6d ago
Help Request Getting TypeError: unsupported operand 'int' and 'str' when summing scores from input()
I'm a few weeks into learning Python and working on a small practice project: a program that asks the user for a few course scores with input(), then calculates the total and the average. Nothing fancy, just trying to get the basics to click.
Here's the code I have right now:
courses = 3
total = 0
scores = []
for i in range(courses):
score = input('Enter score ' + str(i + 1) + ': ')
scores.append(score)
for score in scores:
total = total + score
average = total / courses
print('Average:', average)And this is the error I get:
Traceback (most recent call last):
File "grades.py", line 8, in <module>
total = total + score
TypeError: unsupported operand type(s) for +: 'int' and 'str'I think I get the general idea: input() gives me something that isn't a number, and I'm adding it to total, which starts as the int 0. I searched for this error and a lot of answers mention int(), so I know int() converts a string to a number. What I'm stuck on is where to do the conversion. Should I call int() right when I get the input in the first loop, or wait and convert while summing? And if I convert early, will that break something else, like how I'm storing the scores in the list?
So what type does input() actually return, and what's the cleaner way to write this so the total and average work? Thanks in advance, I appreciate any pointers.
r/PythonLearning • u/onnatsari • 6d ago
Showcase I built a Python tool to automate GitHub repairs and verify CI results
I built GitHub Notification AutoFix to monitor actionable GitHub notifications, attempt fixes with Codex CLI, and verify checks for the exact repair commit before marking a notification as done.
The Python code handles GitHub API requests, SQLite state, retries and mocked tests. Pending checks, missing permissions or a newer commit keep the repair unresolved.
Repairs currently target only repositories owned by my account. Live use requires GitHub credentials and an authenticated Codex CLI.
The interactive demo uses test doubles for GitHub and Codex, so you can explore the verification logic without changing real repositories.
Feedback on the Python structure and test coverage is welcome.
r/PythonLearning • u/ZyGzAcZeQ5 • 6d ago
Looking for someone to build projects with
Hey, Iβm a computer science student from Poland (CET timezone) and Iβve been wanting to find someone to work on some Python projects with. Learning on my own only gets me so far, I feel like Iβd improve way faster if I had someone to build stuff with and bounce ideas off. Also Iβd like to finally have a few real projects on my GitHub, because right now thereβs not much there.
Iβm not picky about what we make, anything we can actually finish. Iβd also like to get better at working with git properly, like PRs and reviewing each otherβs code. Level doesnβt matter that much to me, I just want someone whoβs serious about it and wonβt ghost after a week haha.
If youβre interested, just comment here or DM me and we can talk about what to build :D
r/PythonLearning • u/Illustrious_Button42 • 6d ago
Discussion What modules do people recommend calculus and matrix question generator?
I want to make a random problem generator (also generating the answers) and eventually with some sort of spaced repetition thing, maybe
The best stuff for writing math in python seem to concentrate on making documents for the most part, and I am wondering what my best options for presentability and such
r/PythonLearning • u/Dracunculous • 6d ago
Learning Project: Word-level Markov chain text generator
I wrote a small Python program that generates text using a word-level Markov chain. It reads a source.txt file, builds a dictionary of word sequences and their possible followers, and then generates new text by randomly selecting subsequent words. I'm sharing it here because I'd appreciate feedback on the implementation, particularly code structure, efficiency, and any improvements you might suggest.
"""Word-level Markov chain text generator.
Learns which words follow each ORDER-word group in source.txt,
then generates new text by repeatedly picking a random follower.
"""
from collections import defaultdict
import random
ORDER = 3
STEPS = 50
def build_dict(data):
big_dict = defaultdict(list)
words = data.split()
if len(words) <= ORDER:
raise ValueError(f"Source needs more than {ORDER} words")
length = len(words) - ORDER
for i in range(length):
previous = tuple(words[i : i + ORDER])
following = words[i + ORDER]
big_dict[previous].append(following)
return dict(big_dict)
def generate_text(big_dict):
output_words = list()
keys = list(big_dict.keys())
start = random.choice(keys)
output_words.extend(start)
step = 0
while step < STEPS:
try:
choice = random.choice(big_dict[start])
output_words.append(choice)
start = tuple(output_words[-ORDER:])
except KeyError:
start = random.choice(keys)
output_words.extend(start)
finally:
step += 1
return output_words
if __name__ == "__main__":
with open("source.txt", "r", encoding="utf-8") as file:
data = file.read()
big_dict = build_dict(data)
output_words = generate_text(big_dict)
print(" ".join(output_words))```r/PythonLearning • u/Purple_Bee_4901 • 6d ago
Help Request Trying to learn more than basics
Hi! I'm not the one making the request, but I have been asked and I don't know. This person wants to Learn about the structure of a Software (Data Base, system architecture, Development phases, front and back end). Which are the Best resources for this? Are ther any advise you have? I'm not a Python user so I don't know very well how tu structure this question for you. I know it's a very open-wide question, but any help could be useful. If You need more specification, please ask me so I can't ask this person about it. Thanks You so much for treading!
r/PythonLearning • u/PrithviNotFound • 6d ago
Looking to teach Python to beginners (free/low-cost)
I've covered the fundamentals and quite a bit of the standard library, including:
Python basics
Functions
OOP
Exceptions
File handling
JSON / CSV
Regex
os,shutil,pathlibitertools/functoolsand other standard-library topics
I'm not claiming to be a Python expert. My idea is specifically to help people who are starting from zero or are struggling with the fundamentals. I'd like to teach in a simple, practical way rather than just going through syntax and definitions. We could write small programs together, solve problems, and gradually build up understanding. I'm mainly doing this because I think teaching will also force me to understand the concepts better myself. If anyone here is a complete beginner and would be interested in learning Python with me, feel free to comment or DM me. Also, I'd appreciate advice from people who have taught programming before - What do programmers struggle with ussually? what do u think makes a good python teacher?
r/PythonLearning • u/Business-Feedback635 • 6d ago
Building AI agents in Python? Here's what 354,763 PyPI projects actually import
Most "best agent framework" lists rank by GitHub stars or features. This one counts how many published Python projects import each framework in their code. The data is the latest release of 354,763 PyPI projects, and each framework's own add-on packages (such as langchain-* and crewai-*) are left out.
Projects that import each framework:
LangChain: 6,779
LangGraph: 2,417
Pydantic AI: 1,203
CrewAI: 1,184
LlamaIndex: 1,111
Claude Agent SDK: 973
OpenAI Agents SDK: 840
Worth knowing before you choose:
Most projects use no framework at all. 11,655 of the 14,659 projects that import the OpenAI or Anthropic SDK (79.5%) import none of the 25 frameworks. They call the model API directly.
Projects often use the alternatives together with LangChain rather than instead of it. 820 of the 1,111 LlamaIndex projects also import LangChain.
Download numbers can mislead. Strands Agents had 38M downloads last month, but only 276 projects import it.
The full table covers 25 frameworks. To see real code that uses a framework, search py-code.org for its module (for example pydantic_ai or crewai). Each result links to the file and line.
r/PythonLearning • u/Shut_up_and_Respawn • 6d ago
Showcase Is there anything more satisfying than your code returning a debug check flawlessly?
No but seriously, I spent a week on this, and I can finally almost play battleship against an custom ai opponent.
All code was written by hand. No Ai was used to write or assist with it.
r/PythonLearning • u/Defiant_Meal1898 • 7d ago
Finished a Messaging App
So i am a teen learning Python, and i made this messaging app, as a project, and i would like it to be reviewed. Now, should i keep learning? If yes, what? or should i keep making advanced projects??
And where do i stand rn?
Note: This is a terminal based app.
GitHub Repository Link: https://github.com/suryansh-devx/python-messaging-app
If you have no one to send a message, send me, my ID is 2672
Thanks in advance!
r/PythonLearning • u/Content_Fee_3163 • 7d ago
Engineers out here ! I need your help
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:
Core Applications & Tasks: Where is Python actually used in Mechanical Engineering?
Essential Libraries & Software: Beyond basic Python, which libraries and external engineering software integrate well with Python, and in what order should I learn them?
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?
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 • u/modern-dev • 8d ago
Computer Science Simplified - What Are Threads and Processes? (Python Guide)
Hey guys
Made a video which explains what are threads and processes and how they differ from each other
also it shows how to use them in python via the threading and multiprocessing library
The link is: https://www.youtube.com/watch?v=-Nntexhs124
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!