From 9bddcc1fa35a7baa495682b8ce5755b949bf0b76 Mon Sep 17 00:00:00 2001 From: kirbylife Date: Fri, 9 Aug 2019 20:44:09 -0500 Subject: [PATCH] initial commit --- misc.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 misc.py diff --git a/misc.py b/misc.py new file mode 100644 index 0000000..7b1bfda --- /dev/null +++ b/misc.py @@ -0,0 +1,29 @@ +import base64 +import os +import pickle +import sys +from tkinter import Button, Label, Toplevel + +from tcping import Ping + + +def check_network(ip, port): + return True + ping = Ping(ip, port, 20) + ping.ping(1) + return ping.result.rows[0].successed == 1 + + +def get_os(): + if sys.platform in ["linux", "windows"]: + return sys.platform + raise Exception("OS not supported") + + +def alert(window, message, title="Munyal"): + child = Toplevel(window) + child.title(title) + label = Label(child, text=message) + button = Button(child, text="Aceptar", command=child.destroy) + label.pack() + button.pack()