Import outside toplevel (bad or acceptable?)

Hello! :slight_smile:

I have a need (since I’m very pedantic) to fix a thing that Pylint is complaining about in my code.
Line: 59
pylint: import-outside-toplevel / Import outside toplevel (source.window.main_window) (col 8)

Please look at my code on GitHub HERE and tell me how can I fix that nagging Pylint message.

I’ve tried everything and I can’t have my code working other than importing main_window inside an if block. I read on some forum that having imports like I do indicate a code smell.

All tries other than what I have now give me this error message:
QWidget: Must construct a QApplication before a QWidget

Any help or suggestion would be very welcome. Thanks in advance!

We don’t have access to your code on Github (error 404)