Launching the UI
To launch the UI, we will add a simple function to the __init__.py
file in the gui
module:
import sys from PyQt4.QtGui import QApplication from UnitConverter import UnitConverter
The run_gui
function is used to create a new Qt application and start a new instance of the unit converter user interface. This is the function that will be called by the launch command that we set in the package in the next section.
def run_gui(): app = QApplication(sys.argv) ui_window = UnitConverter(None) ui_window.show() app.exec_()