34 lines
969 B
Python
34 lines
969 B
Python
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
|
from Ui_获取题号 import Ui_Form
|
|
import os
|
|
from database_tools_2 import *
|
|
|
|
class MyWindow(QWidget,Ui_Form):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setupUi(self)
|
|
self.bind()
|
|
def bind(self):
|
|
self.pushButton_exec.setDisabled(True)
|
|
self.pushButton_selectfilepath.clicked.connect(self.selectfilepath)
|
|
self.pushButton_exec.clicked.connect(self.exec)
|
|
def selectfilepath(self):
|
|
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件或.pdf文件",os.getcwd(),"tex或pdf文件(*.tex *.pdf);;所有文件(*)")[0]
|
|
self.lineEdit.setText(self.filepath)
|
|
self.pushButton_exec.setEnabled(True)
|
|
def exec(self):
|
|
self.plainTextEdit.setPlainText(ExportIDList(self.filepath))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = QApplication([])
|
|
windows = MyWindow()
|
|
windows.show()
|
|
app.exec()
|
|
|