def _eval(lstr,locals) :
    """ Evaluate parts of the string. Normal parts ("S") are not modified.
    Expression parts ("E") are evaluated (using eval).
    """
    l=[]
    for t,s in lstr :
        if t=="S" : l.append(s)
        if t=="E" : l.append(str(eval(s,None,locals)))
    return l
 Evaluate parts of the string. Normal parts ("S") are not modified.
    Expression parts ("E") are evaluated (using eval).
    
recipes/Python/578487_Evaluates_string_embedded_expressions_rubstr/recipe-578487.py