<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _save_pys(self, filepath):
 """Saves file as pys file and returns True if save success Parameters filepath: String \tTarget file path for xls file """


        try:
            with Bz2AOpen(filepath, "wb",
                          main_window=self.main_window) as outfile:
                interface = Pys(self.grid.code_array, outfile)
                interface.from_code_array()

        except (IOError, ValueError), err:
            try:
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=err)
                return
            except TypeError:
                # The main window does not exist any more
                pass

        return not outfile.aborted