-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.py
73 lines (65 loc) · 1.58 KB
/
message.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
#!/usr/bin/python2
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import os
def window():
app = QApplication(sys.argv)
w = QWidget()
#b = QPushButton(w)
#b.setText("See")
#b.move(120,100)
#b.clicked.connect(showdialog)
#w.setWindowTitle("Software is setting up please wait")
#w.show()
showdialog()
sys.exit(app.exec_())
def showdialog():
msg = QMessageBox()
msg.setIcon(QMessageBox.Information)
f=open("YourIp.txt","r")
l=f.readlines()
ipcount = []
ic=0
ipadd=""
for o in l:
for w in o:
if(ic==3):
break
if(w=="."):
ic=ic+1
ipadd = ipadd+w
#print ipadd
os.system("nmap -sP "+ipadd+"* -n |grep "+ipadd+" > list.txt")
p=open("Ischild.txt","a")
p.write("2")
f=open("list.txt","r")
line = f.readlines()
k=[]
z=""
count=0
for i in line:
k.append(i)
k[count]=k[count].replace('Nmap scan report for ','')
count=count+1
j = open("iplist.txt","w")
count_new = 0
for i in line:
j.write(k[count_new])
count_new = count_new + 1
j.close()
for i in k:
z=z+i
#msg.setText(z)
#msg.setText(line[1])
#msg.setInformativeText("This is additional information")
#msg.setWindowTitle("MessageBox demo")
#msg.setDetailedText("The details are as follows:")
#msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
#msg.buttonClicked.connect(msgbtn)
#retval = msg.exec_()
#print "value of pressed message box button:", retval
def msgbtn(i):
print "Button pressed is:",i.text()
if __name__ == '__main__':
window()