Home > Blockchain >  How to show status before loading a file with pandas?
How to show status before loading a file with pandas?

Time:12-11

I have a simple app that uses Pandas and PyQT6 to transform an Excel file into a format that's useful for me.

It works the way I want to, but I'd like to add like a label that'd say "Loading..." whenever the file is loading because read_excel takes a few minutes to do that and I want to indicate that the app isn't stuck, it's just processing.

Whenever I try to do something like below, the label doesn't change at all because the app just gets straight to the read_excel function and freezes until the file is loaded. Does anyone know how to properly do it? Thanks!

                self.status_label.setText("Loading...")
                pbireport = pd.read_excel(fname[0])

CodePudding user response:

This is because pd.read_excel(fname[0]) function runs in the main thread. You must use QThread

  • Related