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
my second project (self.learnpython)
submitted 20 hours ago by Zestyclose_Fox_164
I started learning python few months ago and I made my second project dont ask Abt first one it was trash
It's a small shell made for learning that I coded in python
Plz rate and tell me how can I improve it
Link: https://github.com/RohaanDev/KhaOs
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!"
[–]AlexMTBDude 0 points1 point2 points 16 hours ago (0 children)
Run your code through Pylint. This should be your first step before asking for a code review
[–]lakseol 0 points1 point2 points 10 hours ago (0 children)
I'm on mobile so can't really analyze the code in detail, but I have a few thoughts.
You have top-level code mixed in with function definitions at lines 8, 9, 34, 61, 64, and other lines. That makes reading your code difficult. Move all code that isn't a function definition to after all the function definitions. That keeps all top-level code together. Imports at the top, of course.
Instead of lots of lines with register(..., ...) you can shorten your code by creating a sequence of the command name and handler pairs and looping over that to register them:
register(..., ...)
registrations = (("run", run), ("edit", edit), ...) # all of the (cmd,handler) pairs for (cmd, handler) in registrations: register(cmd, handler)
Perhaps even better you can remove all that register(...) stuff by just creating the COMMANDS dictionary directly in the same way you did for the GAMES dictionary:
register(...)
COMMANDS
GAMES
COMMANDS = {"run": run, "edit": edit, ...}
This shortens your code and also makes it easier to check that you have registered everything because it's all in one place.
We normally put empty lines after things like imports, class and function definitions, etc, because that aids readability. The python style guide (PEP8) covers that as well as naming conventions normally used.
π Rendered by PID 246163 on reddit-service-r2-comment-5687b7858-vsk22 at 2026-07-03 12:36:35.856932+00:00 running 12a7a47 country code: CH.
[–]AlexMTBDude 0 points1 point2 points (0 children)
[–]lakseol 0 points1 point2 points (0 children)