def parse_items(fp):
 with open_file(fp, 'U') as f:
  items = f.read().strip('\n').split('\n')
 if (items == ['']):
  items = []
 return items

def parse_items ( fp ) : with open_file ( fp , 'U' ) as f : items = f . read ( ) . strip ( '\n' ) . split ( '\n' ) if ( items == [ '' ] ) : items = [ ] return items
parse items from a file where each item is in a different line parameters fp : str/bytes/unicode string or file-like filepath or file-like object to parse .