How do I fix this login problem?
Muhammad_SJC (4)

I am trying to make a chat room but for that first i need a login menu. I'v coded this so far but i want the usernames and passwords to stay in the code forever, even if i stop and then run the code again. PLs help me.

You are viewing a single comment. View All
RyanRana (168)

One thing you can do if store the values in the text file. Create two files, one for usernames (usernames.txt) and the other one for passwords(passwords.txt). After a new usearnames and password are created to add to the file. When checking a username and password exists check through the list. If you are not good with text files with python here is a couple of good resources to learn about it.
https://www.guru99.com/reading-and-writing-files-in-python.html
https://www.youtube.com/watch?v=Uh2ebFW8OYM
https://realpython.com/read-write-files-python/
https://www.pythonforbeginners.com/files/reading-and-writing-files-in-python
My favorite is the guru99 site. Also, if you need additional help specifically on this project just ask me below. If this post helped please like it. :)

Muhammad_SJC (4)

@RyanRana Can you pls join in my multiplayer and make some changes in my code?
I'm a beginner

RyanRana (168)

@Muhammad_SJC I took a look, your style of coding is a little different than mine. That does not mean it's bad, everybody has a style of coding just like writing. For me, it is a little weird to work on this code just because the format is not usual for me. Thanks for the offer though, but you should try first on your own if you need really specific things than you can ask me.