def text2string(content):
 try:
  return (ast.literal_eval(content) + '\n')
 except Exception:
  return (content + '\n')

def text2string ( content ) : try : return ( ast . literal_eval ( content ) + '\n' ) except Exception : return ( content + '\n' )
returns a string without the extra triple quotes .