This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.config | |
import settings | |
def setup_logging(): | |
logging.config.dictConfig(settings.LOGGING_CONFIG) | |
log = logging.getLogger("sys.excepthook") | |
def excepthook(exc_type, exc_value, exc_traceback): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
def get_number(): | |
return input('Введите число: ') | |
def to_int_or_none(number): | |
try: | |
return int(number) | |
except ValueError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2017 Nick Gashkov | |
# | |
# Distributed under MIT License. See LICENSE file for details. | |
from PyQt5.QtWidgets import QDesktopWidget | |
def center_window_on_screen(window): | |
desktop_widget = QDesktopWidget() | |
screen_size = desktop_widget.screenGeometry() |