code: def removecomment(astr, cphrase):
      
      # linesep = mylib3.getlinesep(astr)
      alist = astr.splitlines()
      for i in range(len(alist)):
          alist1 = alist[i].split(cphrase)
          alist[i] = alist1[0]
  
      # return string.join(alist, linesep)
      return '\n'.join(alist)
docs: the comment is similar to that in python.
      any charachter after the # is treated as a comment
      until the end of the line
      astr is the string to be de-commented
      cphrase is the comment phrase