-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.py
43 lines (34 loc) · 1.02 KB
/
start.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
import sys
import time
import dpkt
import pcap
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import QApplication, QDialog
from scapy.all import *
import select_gui
# list all of the Internet devices
from WhaleTrace import main_start
from getdevs import get_key
devs = get_key('WLAN')
class FirstDialog(QDialog):
def __init__(self, parent=None):
super(QDialog, self).__init__(parent)
self.ui = select_gui.Ui_Dialog()
self.ui.setupUi(self)
for i in devs:
self.ui.devSelect.addItem(i)
def onUpdateText(self, text):
"""Write console output to text widget."""
cursor = self.process.textCursor()
cursor.movePosition(QTextCursor.End)
cursor.insertText(text)
self.process.setTextCursor(cursor)
self.process.ensureCursorVisible()
def beginSniff(self):
main_start()
self.close()
if __name__ == "__main__":
myapp = QApplication(sys.argv)
myDlg = FirstDialog()
myDlg.show()
sys.exit(myapp.exec_())