在python中想要得到文件或图片路径时候往往会\ 发生转义 例如:如图所示 怎样得到下图 代码如下 s = "XXXXXX" new_qr_img_path = s.replace("\\", "/") print(new_qr_img_path)