[Python] Repl.it DB -- variables not updating when program is run again
This is a typing speed program where you can measure how fast you type and get your WPM, accuracy, as well as your average accuracy, highest WPM, etc. I'm looking to save these using repl.it DB, so I use those variables.
However, I have to define those variables, so I set them to 0.
But each time I run the repl, it sets those variables back to 0 which changes the data in the DB.
Could anyone help? When you run the repl, create an account, then press tab to start a test. Note your average WPM, average accuracy, and highest WPM:
Then try to run the repl again. Since the variables are reset back to 0 (lines 152), it resets the variables in the DB as well. So if you do a slower WPM on the second time, it will still use that WPM as the highest, even if you had a higher one on the first try.
Around line 678 is when I add those variables in the DB.
Any help is gladly appreciated! I've tried to add comments to make the code easier, but it may sometimes be messy.
If you need further explanation or want to invited to a repl, pls lmk. My discord is
Bookie0#7538 if it makes it easier.
Thank you so much!
Open repl pls and slide console to see the stuff thanks
Try minxes easypydb instead, it works pretty much the same way, and there is no key limit as far as I can tell :)
This seems to be a problem with replit db, I don't think it's your code. I had the same problem maybe use another database, such as Mongodb