-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathCharacteristicForm.py
27 lines (22 loc) · 1.07 KB
/
CharacteristicForm.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
import os
from PyQt4 import QtCore, QtGui
import Utility
from QTClass import QTCharacteristicForm
class CharacteristicForm(QtGui.QWidget, QTCharacteristicForm.Ui_MainWindow):
def setupUi(self, MainWindow):
super(CharacteristicForm, self).setupUi(MainWindow)
def retranslateUi(self, MainWindow):
super(CharacteristicForm, self).retranslateUi(MainWindow)
self.pushButton.clicked.connect(self.SavetoFile)
def SetOutput(self, listValue):
self.textEdit.setText("")
for key in listValue.keys():
self.textEdit.insertPlainText(str.format("Node {0}: {1}\n", str(key), str(listValue[key])))
def SavetoFile(self):
if self.textEdit.toPlainText() != "":
fileName = QtGui.QFileDialog.getSaveFileName(self, 'Dialog Title', '/path/to/default/centrality_result',
selectedFilter='*.txt')
if fileName:
f = open(fileName, 'w')
f.write(self.textEdit.toPlainText())
f.close()