-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
123 lines (88 loc) · 4.29 KB
/
app.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
from tkinter import *
from tkinter.ttk import Combobox
import tkinter.messagebox
import threading
import platform
import json
class Googles:
def __init__(self,root):
self.root=root
self.root.title("System Inforamtion")
self.root.geometry("500x405")
self.root.iconbitmap("system.ico")
self.root.resizable(0,0)
#=================================================================================#
def clear():
text.delete("1.0","end")
def searchs():
try:
info=[
{
'system':platform.system(),
'node name':platform.node(),
'realese':platform.release(),
'platform version':platform.version(),
'machine':platform.machine(),
'processor':platform.processor(),
'platfrom name':platform.platform(),
'win 32 version':platform.win32_ver(),
'architecture':platform.architecture(),
'java version':platform.java_ver(),
'lib version':platform.libc_ver(),
'mac version':platform.mac_ver(),
'python build':platform.python_build(),
'python version':platform.python_branch(),
'python implemention':platform.python_implementation(),
'python revision':platform.python_revision(),
}
]
x=json.dumps(info,indent=3)
text.insert("end",x)
except Exception as e:
#print(e)
tkinter.messagebox.showerror("Error","Please Enter only Domain Name")
def thread_search():
t1=threading.Thread(target=searchs)
t1.start()
#==================================================================================#
def on_enter1(e):
but_search['background']="black"
but_search['foreground']="cyan"
def on_leave1(e):
but_search['background']="SystemButtonFace"
but_search['foreground']="SystemButtonText"
def on_enter2(e):
but_clear['background']="black"
but_clear['foreground']="cyan"
def on_leave2(e):
but_clear['background']="SystemButtonFace"
but_clear['foreground']="SystemButtonText"
#==================================================================================#
mainframe=Frame(self.root,width=500,height=405,bd=3,relief="ridge")
mainframe.place(x=0,y=0)
firstframe=Frame(mainframe,width=494,height=100,bd=3,relief="ridge")
firstframe.place(x=0,y=0)
secondframe=Frame(mainframe,width=494,height=297,bd=3,relief="ridge")
secondframe.place(x=0,y=100)
#================================firstframe===================================================#
lab_frame=LabelFrame(firstframe,width=488,height=95,text="System Inforamtion",bg="#89b0ae",fg="white")
lab_frame.place(x=0,y=0)
#==============================================================================================#
but_search=Button(lab_frame,width=13,text="Show Info",font=('times new roman',12),cursor="hand2",command=thread_search)
but_search.place(x=50,y=30)
but_search.bind("<Enter>",on_enter1)
but_search.bind("<Leave>",on_leave1)
but_clear=Button(lab_frame,width=13,text="Clear",font=('times new roman',12),cursor="hand2",command=clear)
but_clear.place(x=300,y=30)
but_clear.bind("<Enter>",on_enter2)
but_clear.bind("<Leave>",on_leave2)
#=============================================================================================================#
scol=Scrollbar(secondframe,orient="vertical")
scol.place(relx=1, rely=0, relheight=1, anchor='ne')
text=Text(secondframe,height=15,width=58,font=('times new roman',12),yscrollcommand=scol.set,relief="sunken",bd=3,fg="black")
text.place(x=0,y=0)
scol.config(command=text.yview)
if __name__ == "__main__":
root=Tk()
app=Googles(root)
root.mainloop()