From bea4f19f1f36a4bf010dacadc10b16c509097e0f Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sun, 8 May 2022 18:01:56 +0530 Subject: Artificial Intelligence --- DataBase/Gui Programs/SpeedTestGui.py | 75 +++++++++++++++++++++++++++++++++++ DataBase/Gui Programs/SpeedTestUi.py | 34 ++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 DataBase/Gui Programs/SpeedTestGui.py create mode 100644 DataBase/Gui Programs/SpeedTestUi.py (limited to 'DataBase/Gui Programs') diff --git a/DataBase/Gui Programs/SpeedTestGui.py b/DataBase/Gui Programs/SpeedTestGui.py new file mode 100644 index 0000000..0fa2e47 --- /dev/null +++ b/DataBase/Gui Programs/SpeedTestGui.py @@ -0,0 +1,75 @@ +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * +from PyQt5.QtCore import * +from PyQt5 import QtCore , QtWidgets , QtGui +from PyQt5.QtGui import QMovie +from PyQt5.uic import loadUiType +import sys +import pyttsx3 +from SpeedTestUi import Ui_SpeedTest + +engine = pyttsx3.init('sapi5') +voices = engine.getProperty('voices') +engine.setProperty('voices',voices[0].id) + +def Speak(audio): + print(" ") + print(f": {audio}") + engine.say(audio) + engine.runAndWait() + print(" ") + +def run_uit(): + + Speak("I Am Checking Speed Sir , Wait For A While .") + + import speedtest + + speed = speedtest.Speedtest() + + upload = speed.upload() + + correct_Up = int(int(upload)/800000) + + download = speed.download() + + correct_down = int(int(download)/800000) + + Speak(f"Downloading Speed Is {correct_down} M B Per Second .") + Speak(f"Uploading Speed Is {correct_Up} M B Per Second .") + + exit() + +class MainThread(QThread): + + def __init__(self): + + super(MainThread,self).__init__() + + def run(self): + run_uit() + +StartExe = MainThread() + +class StartExecution(QMainWindow): + + def __init__(self): + + super().__init__() + + self.ui = Ui_SpeedTest() + + self.ui.setupUi(self) + + self.ui.label = QMovie("E:\\Zara\\DataBase\\Gui Materials\\speedTest.gif") + + self.ui.gif.setMovie(self.ui.label) + + self.ui.label.start() + + StartExe.start() + +App = QApplication(sys.argv) +speedtest = StartExecution() +speedtest.show() +exit(App.exec_()) diff --git a/DataBase/Gui Programs/SpeedTestUi.py b/DataBase/Gui Programs/SpeedTestUi.py new file mode 100644 index 0000000..cf7d4a7 --- /dev/null +++ b/DataBase/Gui Programs/SpeedTestUi.py @@ -0,0 +1,34 @@ +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_SpeedTest(object): + + def setupUi(self, SpeedTest): + + SpeedTest.setObjectName("SpeedTest") + SpeedTest.resize(582, 335) + self.centralwidget = QtWidgets.QWidget(SpeedTest) + self.centralwidget.setObjectName("centralwidget") + self.gif = QtWidgets.QLabel(self.centralwidget) + self.gif.setGeometry(QtCore.QRect(-10, 0, 601, 341)) + self.gif.setText("") + self.gif.setPixmap(QtGui.QPixmap("E:\\Zara\\DataBase\\Gui Materials\\speedTest.gif")) + self.gif.setScaledContents(True) + self.gif.setObjectName("gif") + SpeedTest.setCentralWidget(self.centralwidget) + + self.retranslateUi(SpeedTest) + QtCore.QMetaObject.connectSlotsByName(SpeedTest) + + def retranslateUi(self, SpeedTest): + _translate = QtCore.QCoreApplication.translate + SpeedTest.setWindowTitle(_translate("SpeedTest", "MainWindow")) + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + SpeedTest = QtWidgets.QMainWindow() + ui = Ui_SpeedTest() + ui.setupUi(SpeedTest) + SpeedTest.show() + sys.exit(app.exec_()) + -- cgit v1.2.3-59-g8ed1b