按键绑定 self.pushButton_open.clicked.connect(self.ReadPath)
#打开文件夹
def ReadPath(self,Filepath):
cur_path=os.getcwd()
#cur_path=cur_path+"\ExcleData"
print("当前路径",cur_path)
directory = QtWidgets.QFileDialog.getExistingDirectory(None,"选取文件夹",cur_path) # 起始路径
print("选择文件夹",directory)
#打开具体文件
def ReadFile(self,Filepath):
cur_path=os.getcwd()
#cur_path=cur_path+"\ExcleData"
print("当前路径",cur_path)
directory = QtWidgets.QFileDialog.getOpenFileName(self, "选取文件",cur_path, "All Files (*);;Text Files (*.txt)")
print("选择文件名",directory[0])