1
1

recreate_db.py 332 B

1234567891011121314151617
  1. import os
  2. import time
  3. import model
  4. from game import DB_NAME
  5. start = time.clock()
  6. db_name = DB_NAME
  7. try:
  8. os.remove(db_name + '.db')
  9. except FileNotFoundError:
  10. pass
  11. model.connect(db_name, create_if_not_exists=True)
  12. print('db name:', db_name)
  13. model.current_connection.commit()
  14. print('Processing time:', time.clock() - start)