title: how to split main.py file into multiple files?
body: <p>I have 3 files are <code>listwidget.ui</code>, <code>main.py</code> and <code>sub.py</code>.
  This listwidget.ui file created by QtDesigner.
  Below are my example code of main.py and sub.py.</p>
  <blockquote>
  <p>Main.py:</p>
  </blockquote>
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtWidgets import *
  import sys
  from PyQt5 import uic
  import sub
  
  class UI(QDialog):
      def __init__(self):
          super(UI, self).__init__()
          uic.loadUi(&quot;listwidget.ui&quot;, self)
          self.show()
          
          fruit_list = [&quot;Apples&quot;, &quot;pears&quot;, &quot;oranges&quot;, &quot;grapefruits&quot;, &quot;strawberries&quot;]
          self.fruit_list = dict.fromkeys(fruit_list, 0)
          for i in self.fruit_list:
              item = QtWidgets.QListWidgetItem(i)
              item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
              item.setCheckState(QtCore.Qt.Unchecked)
              self.listWidget.addItem(item)
  
          self.searchLineEdit.textChanged.connect(self.filter_items)
  
  app = QApplication(sys.argv)
  window = UI()
  app.exec_()
  </code></pre>
  <blockquote>
  <p>sub.py:</p>
  </blockquote>
  <pre><code>def filter_items(self, text):
      for i in range(self.listWidget.count()):
          item = self.listWidget.item(i)
          item.setHidden(text.lower() not in item.text().lower())
  </code></pre>
  <p>Above is my example program. And i have a python program has lost of functions and thousands of line under one class.  I want to split the main coded as &quot;main.py&quot; file into multiple files. How to split this type of Program.</p>