Skip to content
Sign upLog in
← Back to Community
Auth system - using file.txt
Profile icon
benzheng

This is a Auth system that allows the user to login using data stored in a file.txt and it also allows the user to register
i need help, something is not working.

Voters
Profile icon
815215
Profile icon
a5rocks
Profile icon
benzheng
Comments
hotnewtop
Profile icon
[deleted]

If I was you instead of storing it in a text file store I would store it using the pickle module

Profile icon
a5rocks

You can not get something almost like it was a dictionary from a string.

PW is a string, as indicated from the input right above it (line 22/23). You have a couple other errors with types, like turning the username to a integer when the user is registering.

Profile icon
a5rocks

@a5rocks
https://repl.it/@a5rocks/Auth-system-using-filetxt I fixed all the current mistakes, and used pickle, a (basically) database manager in python.

Profile icon
benzheng

@a5rocks
Thanks bro, this is my first time coding in python and i though i would give it a try, so i appreciate the help

Profile icon
benzheng

@a5rocks
Also what does this mean : �]q
this was displayed in the password file and the username file

Profile icon
a5rocks

@benzheng
First of all, good job on this code! Everything worked, but you just needed to fix some type and overriding things.

Secondly, what I believe pickle does is it just adds the representation of what you are storing in bytes. The characters you mentioned are most likely the binary representation of what tells the program that the variable is an array.

Profile icon
benzheng

i have done something wrong but i cant seem to figure out what i have done wrong.
Hope someone can help me. (Thanks in Advance)