r/PythonLearning • • 38m ago

hello bro i am new to python

0 Upvotes

r/PythonLearning • • 1h ago

Help Request where did the '\n' go?

0 Upvotes

using f.read().split() removes the \n escape sequence, why does that happen?


r/PythonLearning • • 1h ago

Discussion Distraction Is the Enemy of Learning Python

3 Upvotes

One of the biggest obstacles to learning programming is distraction.
You start learning Python, then jump to Django, AI, cybersecurity, or another programming language. You keep searching for better tutorials and new resources instead of focusing on what you are already learning.
The result? You consume a lot of information but make very little practical progress.
**How to avoid this:**

* Stick to one learning path.
* Focus on understanding the fundamentals.
* Spend more time writing code than watching tutorials.
* Avoid switching between resources unnecessarily.
* Practice consistently, even if progress feels slow.

Remember: You don’t need to know everything. You need to focus long enough to learn something properly.
Consistency beats constant switching.
**Have you experienced this problem while learning programming? How do you deal with distraction and avoid constantly switching between topics and resources?**


r/PythonLearning • • 8h ago

I came up with the idea and wrote the code myself, only using AI when I hit errors or needed help fixing specific parts ot to generate the whole thing. Built this contour + shading animation using OpenCV and Turtle after finishing Python, and I'm trying to write even more of it cleanly on my own.

2 Upvotes

rate my project and what should i make next (plz watch in 2X)


r/PythonLearning • • 10h ago

school

0 Upvotes

def fib(n):

if n <= 1:

return n

return fib(n - 1) + fib(n - 2)

n = int(input("Количество чисел: "))

for i in range(n):

print(fib(i), end=" ")


r/PythonLearning • • 10h ago

Paul's Python Course

23 Upvotes

I built a completely free browser-based Python course that goes from print() to building a small GPT
You learn through 116 projects across nine "floors" of a clocktower. Foundations, Fluent Python, Real-World Python, Algorithms, Data Science, ML, Deep Learning and RL. Each project has guided lessons, a buggy program to fix, and your own solution checked by tests. There's spaced review and a placement test if you already know the basics. It's completely free, including certificates.

I'd love feedback from people actually learning:
paulspythoncourse.com


r/PythonLearning • • 11h ago

Discussion why would you use assert instead of if false: raise someerror("custom message about error"). what are the benifits of assert. because it seems that it doesn't save time nor effort, nor does it communicate code better than an if with custom error message

1 Upvotes

r/PythonLearning • • 21h ago

Looking for a first open-source contribution? 238 maintained PyPI packages still import pkg_resources, and the fix is often one line

Thumbnail
py-code.org
6 Upvotes

setuptools 82 (February 2026) removed pkg_resources. Code that still runs import pkg_resources now fails with:

ModuleNotFoundError: No module named 'pkg_resources'

It also fails in any new Python 3.12+ virtual environment, because venv no longer installs setuptools.

I run py-code.org, a search over the code inside PyPI packages. I checked every package that still uses pkg_resources: 1,504 import it with no fallback, so they fail without it. 238 of them had a release in the last six months and have a public repository, so the maintainers are active and can merge a fix.

The fix is usually small, which makes it a good first pull request:

# before
import pkg_resources
requests_version = pkg_resources.get_distribution("requests").version

# after (Python 3.8+)
from importlib.metadata import version
requests_version = version("requests")

For data files inside a package, pkg_resources.resource_filename(pkg, path) becomes importlib.resources.files(pkg) / path (Python 3.9+).

How to do it:

  1. Pick a project from the list (CSV with the file and line of each import, and the repo link): https://github.com/pypi-data/blog/blob/main/pkg-resources-pypi/results/unguarded.csv

  2. Check that it isn't fixed already: search the repo's main branch for pkg_resources, and look at open issues and pull requests.

  3. Replace each call. The post has a table with the replacement for each pkg_resources function.

  4. Test in a fresh virtual environment (python3.12 -m venv), so setuptools isn't there, and run the project's tests.

  5. Open one small pull request. Explain it in one line: "pkg_resources was removed in setuptools 82 and isn't installed by default in Python 3.12+ virtual environments."

Please send one PR per project, and skip any project where someone has already opened one.

Full write-up, with the replacement table and the most downloaded affected packages: https://py-code.org/blog/pkg-resources-pypi/


r/PythonLearning • • 1d ago

Python Mutability: tuple vs list

Post image
17 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 • • 1d ago

I built Pocket Editor: a portable, zero-dependency Python/Tkinter IDE with LSP autocomplete, GDB debugging, AI assistants, and LAN/tunnel team collaboration

Post image
1 Upvotes

Hey r/Python! I’ve been building Pocket Editor, a portable code editor and lightweight IDE written in Python 3.9+ and Tkinter.

The goal was to keep the core editor 100% standard library (python3 + tkinter—no Electron, no Chromium wrapper, and zero required pip dependencies just to launch), while letting you plug in full IDE workflows on demand via modular Python plugins.

Core Editor Features:

  • Fast & Portable: Split-pane editing, Command Palette (Ctrl+Shift+P), fuzzy Quick Open (Ctrl+P), atomic saves preserving BOM/newlines, 5-second crash-recovery snapshots, and a dark UI with vertical dockable plugin tabs.

  • Plugin Architecture: Drop .py files with register(api) into pocket_editor_plugins/. Plugins communicate through an event/service bus on the GUI thread while delegating heavy tasks to background workers. Includes an in-app Plugin Builder, Plugin Manager, and --safe-mode.

  • Built-in Terminal Runner: Bounded output buffer (200k chars) with full ANSI 16/256/RGB color parsing and automatic log-category highlighting (ERROR:, WARNING:, compiler file:line: patterns)—no external ANSI library required.

Optional IDE Plugins Included:

  • Python & JSON: Live background syntax diagnostics (using compile() / json in a worker without executing user code) + Black formatting.

  • C/C++ Tools: clangd LSP autocomplete, clang-format, compiler error underlines, and GDB debugging.

  • PHP Tools: Intelephense LSP completion + Prettier PHP formatting (isolated in a local tools/php Node folder so it never touches the core).

  • AI & Codex CLI: Native Google Gemini API, OpenAI/Ollama/OpenRouter/Groq/DeepSeek presets, plus a wrapper for local Codex CLI workflows.

  • Git & Team Collaboration: Visual Git client + a Team Project plugin that hosts project sync and group chat over LAN or an optional one-click cloudflared HTTPS relay using .team-invite files.


r/PythonLearning • • 1d ago

This was my 2nd game with python. also it was my classes project too if yall would rate it i would appriciate it

Thumbnail
gamejolt.com
3 Upvotes

r/PythonLearning • • 1d ago

Would be nice to find some like-minded people here

18 Upvotes

Hey everyone!

I've been thinking about making this post for a while, so here goes.

I'm currently a university student studying Agriculture, with an interest in Biotechnology. A while ago, I got into programming and started learning Python. At first, I was just following tutorials, but eventually I wanted to build actual things instead of constantly watching other people code.

Right now, I'm working on a project called Business Data Analyzer. It's basically a Python project where I'm trying to build a small tool for analyzing business sales data.

So far, I've implemented data loading and processing with Pandas, data quality checks, duplicate and invalid data detection, sales analysis by product and region, visualizations with Matplotlib, and Excel report generation.

I've also been working on making the code cleaner and more maintainable, using Ruff and writing tests with Pytest. Currently, all 41 of my tests are passing, which honestly feels pretty good considering where I started.

I'm still developing the project and there's a lot I'd like to add to it.

One thing I should mention is that I've been using AI tools quite a bit during development. Not just to generate code, but also to understand errors, explore different solutions, review my code, and figure out how to improve the overall project. I think learning how to work alongside AI is becoming an important skill, and I'm trying to get better at that without losing the ability to understand what I'm actually building.

As for where I'm heading, I have a pretty specific long-term goal.

I want to build a solid foundation in Python, move deeper into data analysis and eventually data science, and then use those skills in Bioinformatics.

Since my university studies are related to Biotechnology, the idea of combining programming with biology, genetics, and medical research is something I'm genuinely excited about.

I know it's a long road, and sometimes when I look at everything I still need to learn, it feels a little overwhelming.

I also haven't made any money from programming yet. No freelance income, no paid projects, nothing so far. And honestly, that sometimes makes me wonder whether I'm moving in the right direction or just spending a lot of time on something that might take years to pay off.

But I enjoy doing it, and that's probably the main reason I keep going.

For me, working on a project, fixing something that took hours to understand, or adding a feature that actually works is genuinely fun. It's almost a hobby at this point, but one I'd really like to turn into a career someday.

Of course, university comes first sometimes. During exams or particularly busy weeks, I might not be able to work on my projects as much as I'd like. But outside those periods, I try to stay consistent and keep making progress.

Anyway, the main reason I'm posting here is that I'd love to meet people who are doing something similar.

Maybe you're learning Python, working on data analysis projects, interested in Bioinformatics, or just trying to build things and improve your skills.

It would be really nice to have someone to share progress with, discuss problems, exchange ideas, review each other's projects, or simply talk about what we're learning.

And if you've already been through this journey and have some experience, I'd genuinely love to hear your advice. Especially about getting that first opportunity, making your first money, and avoiding common mistakes along the way.

I'm not looking for anything formal. Just people with similar interests who want to learn and grow together.

If any of this sounds familiar, feel free to leave a comment or send me a message. I'm happy to connect with anyone, whether you're just starting out or have years of experience.

Good luck to everyone working towards something. We're all figuring things out as we go :)


r/PythonLearning • • 2d ago

Python Plant Management App (PC and Phone) Guidance

5 Upvotes

Hi Folks,

I've started using python for data analysis at work and I'm very much enjoying it. My goal is to build two apps for myself:

- first, a very basic journaling app (think like Google Keep style)

- Then, when I'm ready, a plant management app.

If I enjoy them enough and think they might help others, then I'd consider putting them on the play or itunes store but not a big concern of mine!

I'd still say I'm entry level but have a lot of experience building and managing databases in Access and SQL, data analysis and reporting in SQL, as well as building solutions in Excel and Access.

For both, I'd like to have an app on my desktop and phone and avoid any extra HTML/CSS/Javascript. I was considering web based but i thought it would be great if I could continue to focus just on python, if possible. The database should be synchronized and stored on the cloud. I was also intending to have push notifications for reminders (e.g., plant watering/fertilizing schedules). I'm aiming to keep it simple and scalable.

Anywho, is there an all-in-one Python framework that handles the UI, backend, libraries, and database well for this, or what is the simplest combo of tools to start with?

I'm very comfortable with SQL if there is a solution that includes that!

Note: I'm fully new to this stuff so assume I know nothing. Also, feedback is welcome for any part of this :)

Thank you!

J


r/PythonLearning • • 2d ago

Need feedback on my latest two projects!

12 Upvotes

I have built two useful apps for my personal use (basically automation scripts) and I want your feedback:
Coding-Tracker-Dashboard : an autonomous/standalone script that tracks the time when coding on specified coding enviroment.

Downloads-Folder-Organizer : a script that organizes the files in a specified target folder.


r/PythonLearning • • 3d ago

30 Days, 30 Programs

10 Upvotes

Give me 30 Intermediate level python projects that I can build. I will post 1 project each day and I you guys will be the judge of it. This is also a test to my programming and python knowledge.


r/PythonLearning • • 3d ago

First Full Project!

Post image
203 Upvotes

Made this Calculator in CustomTkinter after a month of learning


r/PythonLearning • • 3d ago

i am stuck with the range function

8 Upvotes

sorry but i am gonna crash out because of the range function i cant understand it well to use it this is driving me crazy any one could give me a video explaining everything i dont mind it being an hour long


r/PythonLearning • • 3d ago

Needs resources for learning Python already knows basics

12 Upvotes

Guys am starting python already know basic c++ from where I should learn like any good playlist and also a good text source currently am learning from w3schools but now things become Lil bit confusing so wants suggestions


r/PythonLearning • • 3d ago

Free Discord for people who want to stop doing tutorials and actually ship projects

7 Upvotes

hey everyone! first of all, the mods approved this post, so no worries about the self-promo 🙂

i started a small Discord server called Ship It. the idea is simple: a place for people who want to actually build stuff, find teammates for projects, get help when they’re stuck, and get some feedback on their code.

some things you’ll find there:

  • a channel to look for teammates or cofounders for your project

  • help and code review channels, no “stupid questions”, all skill levels welcome

  • a showcase for your finished projects and a weekly check-in so you stay motivated

  • voice channels, including a quiet focus room if you like working alongside others

it’s completely free, no paid stuff, no courses, no catch.

the server is open to every programming language, not just Python, but most of the people there are using Python right now, so if you’re learning it you’ll feel at home.

the community is still pretty small and just getting started, but i’m hoping it grows over time, and it’d be great to have more people to build with. if you’re learning and want to turn tutorials into real projects, you’re very welcome to join 🚀

invite link: https://discord.gg/QWGWKFVYyh

happy to answer any questions in the comments or dm!


r/PythonLearning • • 3d ago

Help Request help for a programing assignment

6 Upvotes

I need to write a program that will calculate the sum of the first n of 1 + 1/2 + 1/4 + ... = lim (n -> ∞) Σ 1/2^k =2 starting at k=0 to n.

Teacher said we could use Σ 1/2^k = 2 - 1/2^(n-1) starting at k=0 to n-1

We have to write it using a loop.

I went back through my notes and figured I needed to use a «for» loop.

My teacher starts all of his programs with def, but when I try to look up more infos online I struggle to find others who are using it.

So, here's what I've tried

def estimate_serie (nb_term) : 
sum = 0
for term in range (1, nb_term + 1) : 
sum=sum + 1/(2 ** term)
return sum
print (estimate_serie(5))
print (estimate_serie(8))
print (estimate_serie(12))

it gave me

0.5

0.5

0.5

Btw I am learning this in french so I might not have translated all of it correctly. I've also only been learning for a month, so if my mistakes seem dumb that might explain why.


r/PythonLearning • • 4d ago

print ('hello world')

4 Upvotes

hi how to learn programming in 2027


r/PythonLearning • • 4d ago

Is this suitable for beginners?

Post image
4 Upvotes

r/PythonLearning • • 4d ago

Discussion What code editor do you use?

Post image
194 Upvotes

I use these, i mainly use Coding Python cause the workspace is cleaner.


r/PythonLearning • • 4d ago

Help Request What is the best way to learn data science and data analysis?

11 Upvotes

I am trying to develop a clear plan for learning data science and data analysis. Should I start with Python or Excel? Also, is Excel truly essential for data analysis, or has AI taken its place?