Simple highscore tracking with Python / Flask
Below is a quick tutorial on how flask web framework might be used for simple highscore tracking.
All of the source code the state game is now on github.
This code will accept an AJAX GET or POST at the end of each game so that scores can be tracked and read.
Since the use-cases are simple it's easy to write the tests first:
class StateTestCase(unittest.TestCase): def setUp(self): self.db_fd, state.app.config['DATABASE'] = tempfile.mkstemp() state.app.config['TESTING'] = True self.app = state.app.test_client() state.init_db() def tearDown(self): os.close(self.db_fd) os ...
read more
