code: def editStartScript(self, index):
          
          f = str(self.fileName(index))
          if f.endswith('.%s' % self.file_type):
              zipname = str(self.filePath(index))
              with ZipFile(zipname, 'a') as myzip:
                  # extract+save script in tmp-dir:
                  myzip.extract('__main__.py', self._tmp_dir_work)
                  tempfilename = f[:-4]
                  tempfilepath = os.path.join(self._tmp_dir_work, tempfilename)
                  os.rename(
                      os.path.join(
                          self._tmp_dir_work,
                          '__main__.py'),
                      tempfilepath)
                  self.openTxt(tempfilepath)
                  self._editedSessions[index] = (
                      zipname, self._tmp_dir_work, tempfilename)
docs: open, edit, replace __main__.py