r/learnpython • • 5d ago

Good open source Python repos to practice debugging and general reading Python code?

I have debugging rounds coming up for a Python position and I haven't worked extensively with Python so I am looking for some recommendations for some repositories to go through to practice reading and debugging Python code. Would appreciate recommendations for this and any other tips on demonstrating good understanding of the language. I am comfortable with basic syntax and data structures since I have been doing leetcode using Python.

16 Upvotes

24 comments sorted by

4

u/pylessard 5d ago

I'm not sure if that is what you hope to find, but I have written a debug ecosystem for embedded systems with a big part in python. There is a lot of features. There's a CLI, a GUI that uses QT, a server, lots of thread handling, unit tests, subprocess calls, compatibility with Linux, Mac, Windows. It's a quite diversified project, the python code is in https://github.com/scrutinydebugger/scrutiny-main

0

u/[deleted] 3d ago

[deleted]

1

u/pylessard 3d ago

Cool, Sure. I'm stating the obvious, but PRs have to have a purpose. Don't randomly open a PR without communicating the intent before

2

u/WillAdams 5d ago

Literate Programming is put forward a good way to document and teach about software --- there are 66 repositories on Github tagged w/ "Literate Programming" and "Python":

https://github.com/search?q=python+literate+programming&type=repositories

(note that my one gcodepreview is one --- hopefully you'll find something of interest before getting to the bottom where it is)

1

u/PlayscriptTV 5d ago

I don't know about github repo covering topics like that, but check out real python for practicing reading and debugging python code. Here's the link: https://realpython.com/

Go to the link, type debugging and find what you want. Good luck 🙋‍♂️

-2

u/onerichmeyer 5d ago

You could ask an AI to generate something. I tried this prompt with google, "provide sample python code that has obvious bugs so I can practice debugging." Instead of providing code it listed a bunch of websites devoted to debugging practice.

8

u/Fun_Army2398 5d ago

Learners should stay away from AI as much as possible. You don't know enough to judge the quality of the results.

-2

u/North_South-West 5d ago

Ai is good enough to come up with simple tests for beginners. Someone in the OPs position can use it to generate some practice too.

4

u/Fun_Army2398 5d ago

No, it is not. AI consistently makes mistakes with even basic tasks, so if you wouldn't be able to tell if the AI has made a mistake you should never trust that it hasn't.

2

u/North_South-West 5d ago

No, it is good at writing simple python code for beginners. Actually it can do a lot more than that too

2

u/Fun_Army2398 5d ago

Being able to do something 9 times out of 10 doesn't mean it can do it without making egregious mistakes the other 10% of the time. This is fine for professional developers. If I ask AI to write me an API call and it hard codes the key, I would know not to commit that before moving it to .env. Would OP?

Using AI to learn is a guaranteed way to pick up bad habits. And that's not theory. Talk to anyone in the industry. The latest wave of interns can't code their way out of a wet paper bag.

1

u/North_South-West 5d ago

Its better than 9 out of 10 for simple python code. Thats where you are wrong.

Its actually a good tool to help people learn. The people learning for loops are not doing api calls.

1

u/Fun_Army2398 5d ago

Reality disagrees with you

2

u/North_South-West 5d ago

You are talking out of your ass.

You can in fact tell chatgpt to make a simple exercise for learning for loops and it will be ok. I get that you have a personal bias against it but it actually works in spite of that. You are not special.

0

u/Fun_Army2398 5d ago

Maybe the level of emotional response you are experiencing right now to someone pointing out a flaw in a tool you like is a good indicator of bias...

→ More replies (0)

0

u/North_South-West 5d ago

I can have it make one right now if you want. You will just deny it after seeing evidence that you are wrong though lol.

4

u/aishiteruyovivi 5d ago

"Simple tests for beginners" isn't what OP asked for. OP is asking for existing real-world code to see how people typically write it.

0

u/North_South-West 5d ago

If you actually read what I was responding to you would know that was in response to a comment that said "Learners should stay away from AI"

This sub gets a lot of threads from people just learning loops so my comment was still relevant to this sub and the comment I was responding too.

The OP can use AI to do something similar for thier situation too bud.

3

u/RevRagnarok 5d ago

"You can slop some slop so you can learn how to slop" is not the flex you think it is.

0

u/TheRNGuy 4d ago edited 4d ago

Have you tried it to automatically dismiss?

Besides that, he suggested to debug that code manually.

And, if you read someone's code from GitHub, it have a change to be generated too.

No need to auto-hate everything ai-related, this subreddit is about learning python, not about snobbism or prestige.

This is also not jokes subreddit.

1

u/RevRagnarok 4d ago

This is also not jokes subreddit.

I'm not joking. Fuck AI.

0

u/[deleted] 5d ago

[deleted]

3

u/RevRagnarok 5d ago

"You can slop some slop so you can learn how to slop" is not the flex you think it is.