def main(): # démarrage de la base cwd = os.getcwd() open_db(cwd) # supression des données trop vieilles delete_idee_perime(30, Etat.TERMINE) delete_idee_perime(30, Etat.CORBEILLE) # démarrage de l'IHM (fenêtre principale) app = QtWidgets.QApplication(sys.argv) window_principale = QtWidgets.QMainWindow() ui = MainViewChild() ui.setupUi(window_principale) window_principale.show() sys.exit(app.exec_())
"""SocialBots A collection on different social media bots Created: 2019 Author: Henrik A. Christensen """ from models import close_db, open_db from socialmediabot import SocialMediaBot if __name__ == '__main__': open_db() smb = SocialMediaBot() smb.run() close_db()
#! python3 import matplotlib.pyplot as plt import models session = models.open_db('8.8.8.8') xs = [] ys = [] red_xs = [] red_ys = [] for ping in session.query(models.Ping): if ping.latency is not None: xs.append(ping.date) ys.append(ping.latency) if ping.error is not None: red_xs.append(ping.date) red_ys.append(1000) print(min(xs)) print(max(xs)) plt.xlim((min(xs), max(xs))) plt.scatter(xs, ys, alpha=0.1) plt.scatter(red_xs, red_ys, c='r', s=100) plt.show()
def main(host): session = models.open_db(host) while True: ping_once(session, host) time.sleep(10)