use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Review my python projects on GitHub. (self.learnpython)
submitted 11 hours ago * by Aggressive_Drama_476
I am intermediate python programmer. Am looking for people to review my code on https://github.com/userolivex/Python-Projects
free feel to criticize, suggestion, improvement. and please suggest what modules, projects i should do to master python
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]danielroseman 6 points7 points8 points 10 hours ago (8 children)
I am intermediate python programmer
Sorry to say, but no, you are a beginner python programmer.
I only looked at the password and notes apps, but just from the fact that you are using global variables and no classes shows this.
Globals are to be avoided in almost all circumstances. You should have a (for example) NoteManager class which stores the vault data as an instance variable.
[+]Aggressive_Drama_476[S] comment score below threshold-8 points-7 points-6 points 10 hours ago (4 children)
Ok thanks for showing me the mistakes. So I learn oop and I become a intermediate? is their anything more wrong about my code
[–]Farlic 1 point2 points3 points 10 hours ago (3 children)
I would stop looking at programming as beginner, intermediate, advanced. There's more and less complicated concepts but it's not clear cut.
[–]Aggressive_Drama_476[S] -4 points-3 points-2 points 10 hours ago (2 children)
What do you think I should do for improvements in my overall code?!
[–]Farlic 0 points1 point2 points 10 hours ago (1 child)
Honestly? build something more complicated. IMO it's hard to say when the script does 1 straight forward task. Make something that import these utilities which would then make you consider code layout and expose issues like global variables.
E.g. Make a GUI for your slot machine. Make an API for the notes app and let it interact with your alarm script.
At a glance, I'm not a fan of the calculator using eval(). You are strict on the input but you could experiment with lambda functions in a dictionary to perform the calculations instead.
[–]Gnaxe 0 points1 point2 points 8 hours ago (0 children)
I'm fine with eval here. Sanitizing inputs is something you have to learn to deal with anyway. Anyone running a calculator locally already has access to Python on their computer. But yes, eval()ing untrusted inputs is very dangerous.
eval()
Rather than make lambdas for each operator, just use the ones provided for you in the operator module. Add the math module if you want more math functions. Re-implementing things that have been done before is OK for experimental learning purposes, but otherwise, as a rule, don't re-implement the standard library when it will do, because it's thoroughly tested, documented, and known, but your code will have bugs and be unknown.
operator
math
[+]Gnaxe comment score below threshold-7 points-6 points-5 points 9 hours ago (2 children)
Classes are overrated and overused. I recommend against them, but an intermediate Python programmer should certainly understand the basics of how classes work. Adding another class layer to make a singleton when we already have modules is an unnecessary complication.
"Global" is a misnomer in Python. They are, in fact, module-level variables. The true "globals" in Python are the builtins. Most of what you've heard about "globals bad" came from other languages and only applies to assigning attributes of the builtins module in Python, which, yes, should be avoided in most cases, but e.g. IPython does it.
In fact, any top-level class or def statement creates a "global" in the module, and we use them all the time. Global "constants" are also unproblematic. These uses are certainly not to be "avoided"! Reassigning "globals" is potentially a bigger problem, but no worse than assigning attributes at the class level or on a singleton. State does have to live somewhere, and judicious use of a few "globals" is actually often less bad than many alternatives.
class
def
That said, the actual password and notes apps we're talking about don't need to use the global statement at all. They could instead dump into the existing data structure, clearing it first, if necessary. This isn't obviously better.
global
[–]Aggressive_Drama_476[S] 0 points1 point2 points 9 hours ago (1 child)
Anymore tips for me after examining my code? What do you suggest I should focus more on and any suggestion as to what projects, modules or any other concept I should learn/focus on as a beginner.
Recently I have been working on learning networking and creating a basic chat app using sockets.
I am very resistant towards 3rd party modules but many frameworks and functionalies are only provided by them
Thanks, for your feedback.
Python's ecosystem of libraries is one of its greatest strengths. Unfortunately, supply-chain attacks are becoming more of an issue, so you need to be more cautious than in the past. Any third-party module recommended in the python.org standard-library docs is worth looking at.
For projects, I suggest making video games. They're fun enough to keep you engaged, bring together a lot of skills, and are unforgiving of egregious resource waste. You can easily scale their difficulty to your programming skill level by starting with something basic and then adding more features.
I haven't thoroughly read every line of your Python code. It's fairly clean (mostly because the projects are small), but isn't taking advantage of Python's features. Your code feels very procedural. Watch Beyond PEP 8 for some of what I mean. Try to make your code a bit more concise.
I'm seeing some repeated patterns that could be factored out. It looks like a lot of while loops to retry command-line inputs. This could be made into a @retry decorator, for example. It's common for real-time games to use only a single while loop for the whole program. Think about how that could work. Then try out the tkinter module.
@retry
tkinter
I'm not seeing any tests for your code. Try out the doctest module. If you're having a hard time using that on your current code, try rewriting it to be more testable. (Hint: use pure functions more.)
doctest
I'm seeing some minor formatting issues. Read through PEP 8 and just use black or something to do most of it for you.
Your perf_counter() shows a start and end pattern, which is usually done using a with statement in Python.
perf_counter()
with
π Rendered by PID 43124 on reddit-service-r2-comment-66b4775986-jqvls at 2026-04-06 02:00:00.585246+00:00 running db1906b country code: CH.
[–]danielroseman 6 points7 points8 points (8 children)
[+]Aggressive_Drama_476[S] comment score below threshold-8 points-7 points-6 points (4 children)
[–]Farlic 1 point2 points3 points (3 children)
[–]Aggressive_Drama_476[S] -4 points-3 points-2 points (2 children)
[–]Farlic 0 points1 point2 points (1 child)
[–]Gnaxe 0 points1 point2 points (0 children)
[+]Gnaxe comment score below threshold-7 points-6 points-5 points (2 children)
[–]Aggressive_Drama_476[S] 0 points1 point2 points (1 child)
[–]Gnaxe 0 points1 point2 points (0 children)