def run_spyder(app, options, args):
 main = MainWindow(options)
 try:
  main.setup()
 except BaseException:
  if (main.console is not None):
   try:
    main.console.shell.exit_interpreter()
   except BaseException:
    pass
  raise
 main.show()
 main.post_visible_setup()
 if main.console:
  main.console.shell.interpreter.namespace['spy'] = Spy(app=app, window=main)
 if args:
  for a in args:
   main.open_external_file(a)
 if (sys.platform == 'darwin'):
  QCoreApplication.setAttribute(Qt.AA_DontShowIconsInMenus, True)
 if running_in_mac_app():
  app.sig_open_external_file.connect(main.open_external_file)
 app.focusChanged.connect(main.change_last_focused_widget)
 app.exec_()
 return main

def run_spyder ( app , options , args ) : main = MainWindow ( options ) try : main . setup ( ) except BaseException : if ( main . console is not None ) : try : main . console . shell . exit_interpreter ( ) except BaseException : pass raise main . show ( ) main . post_visible_setup ( ) if main . console : main . console . shell . interpreter . namespace [ 'spy' ] = Spy ( app = app , window = main ) if args : for a in args : main . open_external_file ( a ) if ( sys . platform == 'darwin' ) : QCoreApplication . setAttribute ( Qt . AA_DontShowIconsInMenus , True ) if running_in_mac_app ( ) : app . sig_open_external_file . connect ( main . open_external_file ) app . focusChanged . connect ( main . change_last_focused_widget ) app . exec_ ( ) return main
create and show spyders main window start qapplication event loop .