Python Login System: Using a text file (Beginners Project)

preview_player
Показать описание
This tutorial is a project you can take on as a Python beginner. It exposes you to how to use functions, loops, conditions, and a lot more in Python.

Here, we'll be collecting users' inputs into a text file, then run some checks on those inputs during registration and login. It's just how authentication or login systems work on the internet.

Note that you’d use a real database for a real-life project instead.

I’ve also updated this video to include password encryption. You can continue watching the encryption tutorial here:

Рекомендации по теме
Комментарии
Автор

Came here as a beginner and leaving as a beginner with knowledge on how to make a simple login a lot man...i really appreciate your help...

krupaldudhat
Автор

Great man!! You have become my saviour for my last minute assignment submission

faroozrimaaz
Автор

Thank you so much for this video! Super helpful and just made it so much easier to complete my assignment! Love to see more videos of yours!

mannatbhalla
Автор

Oohhh dude thanks mannn
I was stuck 6 months (ik. Embarrassing)
In this tpc
Great tut btw

sidsdabest
Автор

My 9ja brother. I dey uni for england and this your video just save me like that lol

mjordan
Автор

thank you so much broski your content helped me so much in my tkinter project

ilyasessamhali
Автор

Loved this video. Super clear and really helpful!

MrWezlfc
Автор

really good tut, helped me alot with my studies

alexbrun
Автор

Well done bro. Very useful tutorial. Thanks.

frederickobeng-marnu
Автор

My first data = dict(zip(d, f)) wasn’t used and there was no new line for new signups

lightyagamimlbb
Автор

thank you so much, this is so helpful and you're so funny & kind!

nuramirah
Автор

there are some irrelevant lines of code, which are as follows: try, except do nothing other than override what the if else statements where already doing, pass it does the same thing as not having it there, and print(data) that is bad for security reasons and you can just use the data variable in the elif statement for check weather the input username is the same as another in the text file looks like this (elif Username in data:). I would like to add that you should recall the function whenever something is incorrect in the access function, also you should just say Username does not exist and say that the password is incorrect when the username does exist so it looks something like this:
if data[Username]:
if password == data[Username]:
print("Login Successful.")
print("Welcome, " + Username)
else:
print("Password is incorrect.")
access()
else:
print("Username does not exist.")
access()
the reason why you state things in this way is that it is clearer users to identify errors and help correct them, plus it is not very helpful to tell the User that the password they had inputted doesn't exist when the programme has not checked that the inputted password is correct for the username.
Other than what is above it is a very good programme with a very good tutorial.

flamestardragon
Автор

so I watched this video and got the code but I'm having 2 errors so far, the first one is it says "ModuleNotFoundError: No module named 'bcrypt'" I assumed this was because python in 3.9.7 had integrated it, seems fine once I took it out so that bit doesn't matter, however I keep getting the error:

in Register
a, b = i.split(", ")
ValueError: not enough values to unpack (expected 2, got 1)

I looked the comments and I checked the text file to make sure its completely empty, that didn't help, there is no space between comma and speech mark in a, b = i.split(", ") I also tried just typing the username and password in the text file then login instead but I get the same error message in GainAccess() any help?

Ethiross
Автор

Thank you very much for this video brother, it helped me a lot, I wanted to point something out tho, when it asks you if you want to “Login or Signup” if you type it with a lowercase letter it will cause an erroe

contra
Автор

33:10 The problemim having is that you dont need to enter the full specific login details, for example i can enter "o" for the username and "y" for the password, as it is still detected to be in the line, but it dosent take into account other letters in the same line, help pelase!

ForeignWerewolf
Автор

How would this code look like if i could avoid using dict()? is there any other way to validate username and password?

moemalik
Автор

Traceback (most recent call last):
File "c:/Users/ozte2/Desktop/Programlar/AsistanLogMain/AsistanLogin.py", line 119, in <module>
home()
File "c:/Users/ozte2/Desktop/Programlar/AsistanLogMain/AsistanLogin.py", line 108, in home
gainAccess()
File "c:/Users/ozte2/Desktop/Programlar/AsistanLogMain/AsistanLogin.py", line 17, in gainAccess
a, b = i.split(", ")
ValueError: too many values to unpack (expected 2)

kilicdarogluadayolmasin
Автор

Can u make a project on exam system?
1)admin
2)student
3)Logout
1) Admin can add, remove, update and display questions.
Questions has 4 options.
2)student can give exam and result is shown after exam

mitimehta
Автор

I am getting an error in spilt function called a, b = i.split(".")
ValueError :not enough values to unpack(expected 2, got1) how to solve this error. Pls help

laharik
Автор

why i got this error? ValueError: not enough values to unpack (expected 2, got 1)

gzmxwvh