from PyQt5.QtCore import QThread
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton
class checker(QThread):
def __init__(self):
super().__init__()
def check(self):
try:
request = requests.get("http://www.google.com", timeout=5)
return True
except (requests.ConnectionError, requests.Timeout) as exception:
return False
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Sample")