-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (22 loc) · 1004 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from unittest import result
from pcinfomodule import UserInfo
import PySimpleGUI as sg
from socketclient import clientJsonSend
from staticMode import subprocess_cmd_static, staticCommand
from dynamicMode import subprocess_cmd_dynamic, dynamicComand
layout = [[sg.Button('Static'), sg.Button('Dynamic'), sg.Button("Quit")]]
window = sg.Window('NETTool', layout)
while True:
event, values = window.read()
if event == "Static":
subprocess_cmd_static(staticCommand)
elif event == "Dynamic":
subprocess_cmd_dynamic(dynamicComand)
result = sg.popup_yes_no(f"Przydzielone IP -> {UserInfo.getIP()} \n"
f"Przydzielony MAC -> {UserInfo.getMAC()} \n"
f"Nazwa Komputera -> {UserInfo.getHostname()} \n \n"
"Czy wyslac dane do arkusza?")
if result == "Yes":
clientJsonSend()
elif event == sg.WINDOW_CLOSED or event == "Quit":
break