          config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
          if not config_file:
              return
          if command is None:
              config = {command: {option['control_title']: option['value'].get() for option in options} for command, options in self.opts.items()}
          else:
              config = {command: {option['control_title']: option['value'].get() for option in self.opts[command]}}
          config_file.write(self.serializer.marshal(config))
          config_file.close
  
 
</s> remove         config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
        if not config_file:
 </s> add         cfgfile = filedialog.asksaveasfile( mode='w',
                                            filetypes=self.filetypes, 
                                            defaultextension='.fsw')
        if not cfgfile: </s> remove             config = {command: {option['control_title']: option['value'].get() for option in self.opts[command]}}
        config_file.write(self.serializer.marshal(config))
        config_file.close
 </s> add             cfg = {command: {opt['control_title']: opt['value'].get()
                   for opt in self.opts[command]}}
        cfgfile.write(self.serializer.marshal(cfg))
        cfgfile.close </s> remove         config = self.serializer.unmarshal(config_file.read())
 </s> add         cfg = self.serializer.unmarshal(cfgfile.read()) </s> remove         config_file = filedialog.askopenfile(mode='r', filetypes=self.filetypes)
        if not config_file:
 </s> add         cfgfile = filedialog.askopenfile(mode='r', filetypes=self.filetypes)
        if not cfgfile: </s> remove             for command, options in config.items():
                self.set_command_args(command, options)
 </s> add             for cmd, opts in cfg.items():
                self.set_command_args(cmd, opts)
            cfg = {cmd: {opt['control_title']: opt['value'].get() for opt in opts} 
                   for cmd, opts in self.opts.items()}
          config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
          if not config_file:
              return
          if command is None:
            cfg = {cmd: {opt['control_title']: opt['value'].get() for opt in opts} 
                   for cmd, opts in self.opts.items()}
          else:
              config = {command: {option['control_title']: option['value'].get() for option in self.opts[command]}}
          config_file.write(self.serializer.marshal(config))
          config_file.close
  
keep keep keep keep replace keep keep keep keep keep
 GUI v0.1.0a (#336)

* Code clean up

* Code refactor

* bugfix: Find paths to icons when launched from outside faceswap dir

* Bugfix: Disable GUI if TkInter app not available

* BugFix: Disable GUI if $DISPLAY not detected

* Minor code ammends

* Code Refactor

* DISPLAY check fix 
scripts/gui.py