def create(self, file=None, startpoint=0, mode="w"): if file is not None: self.file = file f = open(self.file, mode) try: for x in self.list[startpoint:]: if os.path.isfile(x): f.write("%s\n" % (os.path.abspath(x))) finally: f.close()