def get_app_qt4(*args, **kwargs):
 from IPython.external.qt_for_kernel import QtGui
 app = QtGui.QApplication.instance()
 if (app is None):
  if (not args):
   args = ([''],)
  app = QtGui.QApplication(*args, **kwargs)
 return app

def get_app_qt4 ( * args , ** kwargs ) : from IPython . external . qt_for_kernel import QtGui app = QtGui . QApplication . instance ( ) if ( app is None ) : if ( not args ) : args = ( [ '' ] , ) app = QtGui . QApplication ( * args , ** kwargs ) return app
create a new qt4 app or return an existing one .