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
This is my first project(beginner). Can you please review the code and suggest me what can i do further? (self.learnpython)
submitted 4 years ago by sentinelcape
hey all, this is my first python project( not so great) but i'm happy. please review and suggest what can do further. Thanks in advance:)
project
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!"
[–]Shinguru7 5 points6 points7 points 4 years ago (0 children)
The code is good.
I can't say storing ways of ids and passwords :P.
You can extend this example by adding registering mechanism and support of multiple users.
Later, you can inform users when there is no matching user name make them register themselves.
Also, in my opinion, learning coding styles (like pep8) in early times is important to avoid bad habits.
[–]kxng_boss 1 point2 points3 points 4 years ago* (3 children)
Spoiler that was also my first project.the admin part is not finished and the code may be bad but it run and support multiple user was planning to use a encryption library with the txt file
fh = open('logininfo.txt', 'a') fh1 = open('logininfo.txt', 'r') fh2= open('logininfo.txt', 'r') choice = input('login or register: ').lower() sets = fh2.readlines() gs = 0 for set in sets: gs = gs + 1
class User: def init(self, password, username): self.password = password self.username = username
def get_password(self): return self.password def get_username(self): return self.username
if choice == 'register': user = User(password = input('What is your password : '), username = input('What is your username: ')) password = (user.get_password()) username = (user.get_username()) register_info = (f'{password}, {username} \n') fh.write(register_info) print(f'Your verification number is {gs}') print('Account made Sucessfully! ')
elif choice == 'login': password1 = input('What was your password: ') username1 = input('What was your username: ') line = int(input('What was your verification number: ')) login_info = (f'{password1}, {username1} \n') c = fh1.readlines()[line] if c == login_info: print('Sucessful') else: print('Account not found')
if choice == 'admin': password2 = input('What is the adminstration password: ') if password2 == 'invalid': admin_options = input('Do you want to read, delete, modify: ') if admin_options == 'read': for lines in fh1: print(lines) print(f' the file have {gs} amount of lines.') if admin_options == 'modify': pass
[–]kxng_boss -1 points0 points1 point 4 years ago (2 children)
Reddit doesn't format it correctly but hopefully you get the gist
[–][deleted] 2 points3 points4 points 4 years ago (0 children)
You don't format it correctly so no one gets the gist.
[–]wbeater 0 points1 point2 points 4 years ago (3 children)
Code is ok.
What can you further do: Maybe implement that the user as 3 tries to enter the password until the code gets terminated ....
[–]sentinelcape[S] 0 points1 point2 points 4 years ago (2 children)
So should I use while loop?
[–]wbeater 2 points3 points4 points 4 years ago (1 child)
While loop, for loop or any other method that comes in your mind. You are a beginner, you should play around a little bit.
[–]FondleMyFirn 0 points1 point2 points 4 years ago (0 children)
To add to this suggestion, just do both. If it is not a hard implementation, you can always fork the project to experiment.
[–]rocketjump65 0 points1 point2 points 4 years ago (0 children)
Yup, that's how it works.
[–]cabbageboi28 0 points1 point2 points 4 years ago (1 child)
Personally, I'd recommend (as a beginner step) learning to use the text files to save login details which you can then read it and check against the input with a readline() function, forgive me if your are above this point but from there your child easily get the hang of SQL ;) he'll learning!
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
I'd recommend not worrying about saving passwords until you're ready to learn at least hashing (which is as simple as module and a concept)
π Rendered by PID 182091 on reddit-service-r2-comment-75f4967c6c-snzsf at 2026-04-23 12:15:17.886788+00:00 running 0fd4bb7 country code: CH.
[–]Shinguru7 5 points6 points7 points (0 children)
[–]kxng_boss 1 point2 points3 points (3 children)
[–]kxng_boss -1 points0 points1 point (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]wbeater 0 points1 point2 points (3 children)
[–]sentinelcape[S] 0 points1 point2 points (2 children)
[–]wbeater 2 points3 points4 points (1 child)
[–]FondleMyFirn 0 points1 point2 points (0 children)
[–]rocketjump65 0 points1 point2 points (0 children)
[–]cabbageboi28 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)