Skip to content

Commit 87817ef

Browse files
done v1.0
1 parent 8897e8a commit 87817ef

File tree

8 files changed

+28
-33
lines changed

8 files changed

+28
-33
lines changed

.idea/workspace.xml

Lines changed: 3 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UI.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def setupUi(self, MainWindow):
138138
self.verticalLayout_2.setStretch(3, 20)
139139
MainWindow.setCentralWidget(self.centralwidget)
140140
self.menubar = QtWidgets.QMenuBar(MainWindow)
141-
self.menubar.setGeometry(QtCore.QRect(0, 0, 600, 23))
141+
self.menubar.setGeometry(QtCore.QRect(0, 0, 600, 26))
142142
self.menubar.setObjectName("menubar")
143143
MainWindow.setMenuBar(self.menubar)
144144
self.statusbar = QtWidgets.QStatusBar(MainWindow)
@@ -170,9 +170,9 @@ def retranslateUi(self, MainWindow):
170170
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">4.选择待查重代码的语言</span></p>\n"
171171
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">5.点击进行查重</span></p>\n"
172172
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">6.查重结果以文本文件的形式保存在所选择的目录下。</span></p>\n"
173-
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">sim_res.txt 保存大致结果,sim_res_all.txt 保存详细结果,程序界面只输出大致结果。</span></p>\n"
173+
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">sim_res.txt 保存大致结果,sim_res_all.txt 保存详细结果</span></p>\n"
174174
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'-apple-system\'; color:#24292e;\"><br /></p>\n"
175-
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e;\"> Made by ZXF</span></p></body></html>"))
175+
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e;\">Made by ZXF</span></p></body></html>"))
176176
self.languageLabel.setText(_translate("MainWindow", "选择待查重程序语言"))
177177
self.languageComboBox.setItemText(0, _translate("MainWindow", "C"))
178178
self.languageComboBox.setItemText(1, _translate("MainWindow", "C++"))

UI.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ p, li { white-space: pre-wrap; }
169169
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e; background-color:#ffffff;&quot;&gt;4.选择待查重代码的语言&lt;/span&gt;&lt;/p&gt;
170170
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e; background-color:#ffffff;&quot;&gt;5.点击进行查重&lt;/span&gt;&lt;/p&gt;
171171
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e; background-color:#ffffff;&quot;&gt;6.查重结果以文本文件的形式保存在所选择的目录下。&lt;/span&gt;&lt;/p&gt;
172-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e; background-color:#ffffff;&quot;&gt;sim_res.txt 保存大致结果,sim_res_all.txt 保存详细结果,程序界面只输出大致结果。&lt;/span&gt;&lt;/p&gt;
172+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e; background-color:#ffffff;&quot;&gt;sim_res.txt 保存大致结果,sim_res_all.txt 保存详细结果&lt;/span&gt;&lt;/p&gt;
173173
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'-apple-system'; color:#24292e;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
174-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e;&quot;&gt; Made by ZXF&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
174+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'-apple-system'; color:#24292e;&quot;&gt;Made by ZXF&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
175175
</property>
176176
</widget>
177177
</item>
@@ -431,7 +431,7 @@ p, li { white-space: pre-wrap; }
431431
<x>0</x>
432432
<y>0</y>
433433
<width>600</width>
434-
<height>23</height>
434+
<height>26</height>
435435
</rect>
436436
</property>
437437
</widget>

__pycache__/UI.cpython-37.pyc

-66 Bytes
Binary file not shown.
5 Bytes
Binary file not shown.

__pycache__/runSIM.cpython-37.pyc

-28 Bytes
Binary file not shown.

main.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,23 @@ def changeFilesName(self):
3737

3838
def startRunSIM(self):
3939
mode = self.languageComboBox.currentText()
40+
startTime = time.time()
41+
4042
argv = '-p -t ' + self.limitSpinBox.text()
4143
argv = argv + ' -o ' + os.path.join(self.filePathEdit.text(), 'sim_res.txt')
4244
argv = argv + ' ' + os.path.join(self.filePathEdit.text(), '*.*')
43-
print(argv)
44-
res = runSIM.runSIM(mode, argv)
45-
self.resultText.setText(res)
45+
# print(argv)
46+
runSIM.runSIM(mode, argv)
47+
48+
argv = '-o ' + os.path.join(self.filePathEdit.text(), 'sim_res_all.txt')
49+
argv = argv + ' ' + os.path.join(self.filePathEdit.text(), '*.*')
50+
runSIM.runSIM(mode, argv)
51+
52+
endTime = time.time()
53+
self.resultText.setText('查重完成\n结果见sim_res.txt和sim_res_all.txt')
54+
self.resultText.append("共耗时%.6fs" % (endTime - startTime))
55+
self.startButton.setEnabled(False)
56+
self.changeNameButton.setEnabled(False)
4657

4758

4859
if __name__ == '__main__':

runSIM.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import os
3+
import subprocess
4+
35
import win32api
46

57

@@ -9,11 +11,6 @@ def runSIM(mode, argv):
911
fileName = 'sim_' + mode + '.exe'
1012
nowPath = os.path.join(nowPath, fileName)
1113
# print(nowPath)
12-
# argv = nowPath + ' ' + argv
13-
res = win32api.ShellExecute(0, 'open', nowPath, argv, '', 0)
14-
15-
return res
16-
17-
18-
if __name__ == '__main__':
19-
runSIM('C++', '123')
14+
argv = nowPath + ' ' + argv
15+
res = os.popen(argv)
16+
res.close()

0 commit comments

Comments
 (0)