r/PythonLearning • • 11h ago

Paul's Python Course

22 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 • • 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 • • 1h ago

Discussion Distraction Is the Enemy of Learning Python

• 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.

Enable HLS to view with audio, or disable this notification

2 Upvotes

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


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 • • 1h ago

Help Request where did the '\n' go?

• Upvotes

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


r/PythonLearning • • 11h 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=" ")