(Mar-05-2023, 09:17 PM)deanhystad Wrote: A json file is text, just like a CSV file is text. Both are just a special way to format text in a file. Probably a good idea to stick with a CSV format file as it looks more "texty".
BTW, this does nothing:
f.closeIf you want to close the file it should be f.close(). However, you don't need to close the file because that is handled by your file open context manager (with open(r'leaderboard.txt', 'a') as f:).
You need to tell us what problem you are having, and you should post some code showing how you are trying to read the information from the file. So far, the only code you've posted is one that reads strings from the file. You need something that will read names and scores. Since it is a CSV format file I wonder if there are any Python tools for reading that kind of file?
Hmm... I'm not sure what you're getting at, sorry. We're using a .txt file.
I forgot to put the (). My apologies.
Also, I've been trying to show you the code for what we've done. And explained it (although badly I think?). Yeah, we do, but the only thing we're allowed to use (I believe) is
import random import os.path import json random.seed()
We're only allowed to use those packages. I'm just not sure how we're going to do the loading and saving in the predefined list. That's the main reason why I asked here. I've showed you the code we're working with, and we're confused on how to get it to work.

Any help would be appreciated again.
Thanks. And sorry if I sounded rude.