Home > Net >  How to create a leader board in repl.it python
How to create a leader board in repl.it python

Time:10-22

I'm trying to make a game with a leaderboard, and I have the code that writes the high scores in a file, but when multiple people play the game, they have separate leaderboards. so basically, i'm asking if there's a way to have everyone share a file in repl.it.

CodePudding user response:

If your code is writing to local files e.g. via open('some_file.txt'), then those are limited to the individual user's Repl.it workspaces.

If you must use files, then you could use any of the Dropbox, Git, AWS S3, Google Drive Python libraries to read/write external files.

However, the better solution would be to use a hosted database solution and connect Repl.it to that. Some popular (free) examples include Firebase, Mongo Atlas, or Datastax Astra. For a simple leaderboard counter, then even Grafana Cloud.

  • Related