def get_date_from_file(filepath, sep):
 with open(filepath) as f:
  line = f.readline()
  try:
   return line.split(sep)[0]
  except IndexError:
   return None

def get_date_from_file ( filepath , sep ) : with open ( filepath ) as f : line = f . readline ( ) try : return line . split ( sep ) [ 0 ] except IndexError : return None
get the date from the file .