code: def polygon_load(filename):
      '''load a polygon from a file'''
      ret = []
      f = open(filename)
      for line in f:
          if line.startswith('#'):
              continue
          line = line.strip()
          if not line:
              continue
          a = line.split()
          if len(a) != 2:
              raise RuntimeError("invalid polygon line: %s" % line)
          ret.append((float(a[0]), float(a[1])))
      f.close()
      return ref polygon_load(filename):
      '''load a polygon from a file'''
      ret = []
      f = open(filename)
      for line in f:
          if line.startswith('#'):
              continue
          line = line.strip()
          if not line:
              continue
          a = line.split()
          if len(a) != 2:
              raise RuntimeError("invalid polygon line: %s" % line)
          ret.append((float(a[0]), float(a[1])))
      f.close()
      return ret
docs: load a polygon from a file