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()