1.当循环目录下的文件列表时,还可以用占位符:
for m in range(1,3):
file = 'F:\\pins_two\\user_xinxi\\pins_two_%d.json'
print(file%m)
2.如果向数据库中插入的值自带单引号,则在sql语句中,要将此字段加入转义的双引号:
+" ' "+ls[j]['xinxi']['full_name']+" ' "+"," //错误
+" \" "+ls[j]['xinxi']['full_name']+" \" "+"," //正确
网友评论