main.py 577 字节
Newer Older
L
Leodanis Pozo Ramos 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
# -*- coding: utf-8 -*-

"""This module provides RP Contacts application."""

import sys

from PyQt5.QtWidgets import QApplication

from .database import createConnection
from .views import Window


def main():
L
Leodanis Pozo Ramos 已提交
14
    """RP Contacts main function."""
L
Leodanis Pozo Ramos 已提交
15 16 17 18 19 20 21 22 23 24
    # Create the application
    app = QApplication(sys.argv)
    # Connect to the database before creating any window
    if not createConnection("contacts.sqlite"):
        sys.exit(1)
    # Create the main window if the connection succeeded
    win = Window()
    win.show()
    # Run the event loop
    sys.exit(app.exec_())