import sys from pathlib import Path sys.path.append(str(Path(__file__).resolve().parent)) from PyQt6 import QtWidgets from ui.main_window_view import PokemonUI from cache import cache from db import db def main(): import sys app = QtWidgets.QApplication(sys.argv) ui = PokemonUI() ui.show() sys.exit(app.exec()) if __name__ == "__main__": try: main() finally: # Ensure the cache is closed at the end of the application cache.close() db.close()