0

I choose the directory with the input files, and it is shown in the right part of tab.

In my case, I want to see the contents of each input file, when I click on it, in the left part of the tab. I use qt.list.itemClicked to choose the file, which should be shown in qt.tableView However, for now, it's just exits with the exit code -1073740791 (0xC0000409)

Here is the look of the interface

Have you got solution?

My code:

import sys
import os
from PyQt5 import QtWidgets
import design
import pandas as pd

class interface(QtWidgets.QMainWindow, design.Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.new_analysis.triggered.connect(self.browse_input_folder)
        self.listOfInputs.itemClicked.connect(self.input_show)
    def browse_input_folder(self):
        directory = QtWidgets.QFileDialog.getExistingDirectory(self, 'Выберите папку с исходными данными:')
        if directory:
            for file_name in os.listdir(directory):
                self.listOfInputs.addItem(file_name)
    def input_show(self, filename):
        input_file = pd.ExcelFile(filename)
        table = pd.read_excel(input_file, names=['Время, час', 'S3', 'S1', 'e1', 'e3'], skiprows=1, usecols='A:E')
        self.tableShow.clear()
        self.tableShow(table)

def main():
    app = QtWidgets.QApplication(sys.argv)
    window = interface()
    window.show()
    app.exec_()
if __name__ == '__main__':
    main()
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Dmitry
  • 1
  • 2
  • What exactly causes you troubles? – scopchanov Sep 28 '20 at 10:59
  • idk, but I can't get the dataframe in the tableview widget. It's just processed with 1073740791 (0xC0000409) error – Dmitry Sep 28 '20 at 11:09
  • Please add all the necessary details in the question. Please note, that: _Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers._ – scopchanov Sep 28 '20 at 11:16
  • Really sorry for this, as you see, it's my first time here. Changed the question a bit – Dmitry Sep 28 '20 at 11:30

0 Answers0