dd=["aa\ii","bb\kk","cc\yy","dd\yy","dd\ii"] print("分割前:",dd) print("分割后:",[dd.split('\\')[0] for dd in dd]) image.png