解决办法: 先去回车: d3 = d2.replace('\n', '') 再把单引号替换为双引号。d3 = d3.replace("'", '"') 转载于:https://www.cnblogs.com/lance2088/p/4092578.html