marclelamy / TyPy

Game in terminal to make you type faster by analyzing your typing history playing the game and proposing words you suck at
0 stars 0 forks source link

First game not finished creates a database error for following games #7

Open marclelamy opened 1 year ago

marclelamy commented 1 year ago

need to make a check to that if the db file exist but doesn't have any table in it, then create them and make self.first_game = True

marclelamy commented 1 year ago

Similar to that for end game


  File "/Users/ml519d/TyPy/src/game.py", line 155, in confirm_game_settings_before_game
    self.start_game()
  File "/Users/ml519d/TyPy/src/game.py", line 312, in start_game
    self.end_game(
  File "/Users/ml519d/TyPy/src/game.py", line 462, in end_game
    self.compare_game()
  File "/Users/ml519d/TyPy/src/game.py", line 547, in compare_game
    df = pd.read_sql_query(f'select * from summary_per_game where 1=1 {general_condition}', self.con)
  File "/Users/ml519d/opt/miniconda3/envs/typy/lib/python3.8/site-packages/pandas/io/sql.py", line 397, in read_sql_query
    return pandas_sql.read_query(
  File "/Users/ml519d/opt/miniconda3/envs/typy/lib/python3.8/site-packages/pandas/io/sql.py", line 2078, in read_query
    cursor = self.execute(*args)
  File "/Users/ml519d/opt/miniconda3/envs/typy/lib/python3.8/site-packages/pandas/io/sql.py", line 2030, in execute
    raise ex from exc
pandas.errors.DatabaseError: Execution failed on sql 'select * from summary_per_game where 1=1  AND word_count = 25  AND word_length_max = 1000  AND word_length_min = 4  AND capitalized_words = 0  AND capitalized_letters = 0  AND punctuation = 0  AND force_shift = 0  AND difficulty = "Medium"  AND train = False  AND train_easy = False ': no such table: summary_per_game