  
      def execute_script(self, options, command, parser, statustext):
          self.opts = options
          self.command = command
          self.parser = parser
          self.statustext = statustext
          
          optlist = ['faceswap.py', self.command]
          for item in self.opts[self.command]:
              optval = str(item.get('value','').get())
              opt = item['opts'][0]
              if optval == 'False' or optval == '':
                  continue
              elif optval == 'True':
                  optlist.append(opt)
 
</s> remove                 optlist.append(opt)
 </s> add                 if self.command == 'train' and opt == '-p':  # Embed the preview pane
                    self.args.append('-gui')
                else:
                    self.args.append(opt) </s> remove     def execute_script(self, options, command, parser, statustext):
        self.opts = options
 </s> add         self.command = None
        self.args = None
        self.process = None
        self.lenloss = 0

    def prepare(self, options, command):
        """ Prepare for running the subprocess """ </s> remove     def bad_args(self, args):
        self.parser.print_help()
        exit(0)
 </s> add     def __init__(self, utils, calling_file="faceswap.py"):
        self.pathexecscript = os.path.join(PATHSCRIPT, calling_file)
        self.utils = utils </s> remove             ctl = tk.Checkbutton
 </s> add             ctl = ttk.Checkbutton </s> remove         if not check_display(cmd) or not import_tkinter(cmd):
 </s> add         if not self.check_display(cmd) or not self.check_tkinter_available(cmd):
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
  
      def execute_script(self, options, command, parser, statustext):
          self.opts = options
          self.command = command
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
        self.utils.runningtask = True
        self.utils.change_action_button()
        self.utils.guitext['status'].set('Executing - ' + self.command + '.py')
        print('Loading...')
        self.args = ['python', '-u', self.pathexecscript, self.command]
        self.build_args(options)

    def build_args(self, options):
        """ Build the faceswap command and arguments list """
        for item in options[self.command]:
            optval = str(item.get('value', '').get())
              opt = item['opts'][0]
              if optval == 'False' or optval == '':
                  continue
              elif optval == 'True':
                  optlist.append(opt)
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 GUI v0.2.1b (#352)

* Code refactor

* Console Added

* Add graphing with matplotlib

* Add GUI preview support

* Improve import handling.

* Add GUI integration for tools.py (Launch tools.py with the gui command)

* Reformat to conform to PEP8.

* Add Tooltips, 

* Make panels user adjustable

* Fix convert.py Sharpen default value 
scripts/gui.py