python 转义json串
import re
body=r'''
{"id":${BXbiztripinfoID_10},"msg":"1234测试审批${__UUID}","bussJson":"{\"companyId\":${__P(orgId,)},\"createUser\":${__P(userId,)},\"auditState\":2,\"orderNo\":\"${BXorderNo_10}\",\"dtContentDetail\":{\"templateId\":${__P(ReimbursementTemplateID,)},\"dtContent\":\"{\\\\\"companyid\\\\\":0,\\\\\"createtime\\\\\":1526371599000,\\\\\"dtComponentList\\\\\":[{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11015,\\\\\"createtime\\\\\":1540883126000,\\\\\"data\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)}}]\\\\\",\\\\\"id\\\\\":143940,\\\\\"label\\\\\":\\\\\"多人报销\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请选择报销人\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"select\\\\\",\\\\\"value\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)}}]\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11001,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"${__P(profitCenterName,)}\\\\\",\\\\\"id\\\\\":15603,\\\\\"label\\\\\":\\\\\"单位名称\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"placeholder\\\\\":\\\\\"请选择利润中心\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"select\\\\\",\\\\\"value\\\\\":\\\\\"${__P(profitCenterName,)}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11010,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"${__P(costCenterName,)}\\\\\",\\\\\"id\\\\\":15610,\\\\\"label\\\\\":\\\\\"部门\\\\\",\\\\\"maxlen\\\\\":50,\\\\\"placeholder\\\\\":\\\\\"请选择部门\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"text\\\\\",\\\\\"value\\\\\":\\\\\"${__P(costCenter,)}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11002,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"{\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"成本中心\\\\\\\\\\\\\"}\\\\\",\\\\\"id\\\\\":15604,\\\\\"label\\\\\":\\\\\"成本分配\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"options\\\\\":\\\\\"[{\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"成本中心\\\\\\\\\\\\\",\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"1\\\\\\\\\\\\\"},{\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"WBS\\\\\\\\\\\\\",\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"2\\\\\\\\\\\\\"},{\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"内部订单号\\\\\\\\\\\\\",\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"3\\\\\\\\\\\\\"},{\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"成本中心\\\\u0026WBS\\\\\\\\\\\\\",\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"4\\\\\\\\\\\\\"},{\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"成本中心\\\\u0026内部订单号\\\\\\\\\\\\\",\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"5\\\\\\\\\\\\\"}]\\\\\",\\\\\"optionsJsonObject\\\\\":[{\\\\\"label\\\\\":\\\\\"成本中心\\\\\",\\\\\"value\\\\\":\\\\\"1\\\\\"},{\\\\\"label\\\\\":\\\\\"WBS\\\\\",\\\\\"value\\\\\":\\\\\"2\\\\\"},{\\\\\"label\\\\\":\\\\\"内部订单号\\\\\",\\\\\"value\\\\\":\\\\\"3\\\\\"},{\\\\\"label\\\\\":\\\\\"成本中心\\\\u0026WBS\\\\\",\\\\\"value\\\\\":\\\\\"4\\\\\"},{\\\\\"label\\\\\":\\\\\"成本中心\\\\u0026内部订单号\\\\\",\\\\\"value\\\\\":\\\\\"5\\\\\"}],\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"childred\\\\\\\\\\\\\":{\\\\\\\\\\\\\"bizAlias\\\\\\\\\\\\\":\\\\\\\\\\\\\"costTypeAddInfo\\\\\\\\\\\\\",\\\\\\\\\\\\\"placeholder\\\\\\\\\\\\\":\\\\\\\\\\\\\"\\\\\\\\\\\\\",\\\\\\\\\\\\\"required\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"type\\\\\\\\\\\\\":\\\\\\\\\\\\\"text\\\\\\\\\\\\\"}}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请选择成本分配\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"select\\\\\",\\\\\"value\\\\\":\\\\\"{\\\\\\\\\\\\\"value\\\\\\\\\\\\\":\\\\\\\\\\\\\"1\\\\\\\\\\\\\"}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11013,\\\\\"createtime\\\\\":1537521553000,\\\\\"data\\\\\":\\\\\"生产成本\\\\\",\\\\\"id\\\\\":143292,\\\\\"label\\\\\":\\\\\"费用类型\\\\\",\\\\\"maxlen\\\\\":50,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请选择费用类型\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"select\\\\\",\\\\\"value\\\\\":\\\\\"14\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11011,\\\\\"createtime\\\\\":1544508206000,\\\\\"data\\\\\":\\\\\"${__Random(1,99999,)}\\\\\",\\\\\"id\\\\\":144699,\\\\\"label\\\\\":\\\\\"出差天数\\\\\",\\\\\"maxlen\\\\\":3,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"isautocal\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"maxNumber\\\\\\\\\\\\\":3,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请输入出差天数\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"3\\\\\",\\\\\"type\\\\\":\\\\\"text_number\\\\\",\\\\\"value\\\\\":\\\\\"${__Random(1,99999,)}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11003,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"${__Random(1,99999,)}\\\\\",\\\\\"id\\\\\":15605,\\\\\"label\\\\\":\\\\\"附件张数\\\\\",\\\\\"maxlen\\\\\":3,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"maxNumber\\\\\\\\\\\\\":3,\\\\\\\\\\\\\"settingNumber\\\\\\\\\\\\\":true}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请输入附件张数\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"3\\\\\",\\\\\"type\\\\\":\\\\\"text_num\\\\\",\\\\\"value\\\\\":\\\\\"${__Random(1,99999,)}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11021,\\\\\"createtime\\\\\":1544584818000,\\\\\"data\\\\\":\\\\\"1234测试报销事由${__UUID}\\\\\",\\\\\"id\\\\\":144735,\\\\\"label\\\\\":\\\\\"报销事由\\\\\",\\\\\"maxlen\\\\\":200,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请填写报销事由\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"4\\\\\",\\\\\"type\\\\\":\\\\\"text\\\\\",\\\\\"value\\\\\":\\\\\"1234测试报销事由${__UUID}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11014,\\\\\"createtime\\\\\":1538247854000,\\\\\"data\\\\\":\\\\\"\\\\\",\\\\\"id\\\\\":143543,\\\\\"label\\\\\":\\\\\"上传图像\\\\\",\\\\\"maxlen\\\\\":80,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"maxlen\\\\\\\\\\\\\":80,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false,\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":80,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"请选择需要上传的图像\\\\\",\\\\\"required\\\\\":\\\\\"false\\\\\",\\\\\"style\\\\\":\\\\\"1\\\\\",\\\\\"type\\\\\":\\\\\"file\\\\\",\\\\\"value\\\\\":\\\\\"\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11017,\\\\\"createtime\\\\\":1542961359000,\\\\\"data\\\\\":\\\\\"{\\\\\\\\\\\\\"foodFee\\\\\\\\\\\\\":[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}],\\\\\\\\\\\\\"publicFee\\\\\\\\\\\\\":[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}]}\\\\\",\\\\\"id\\\\\":144294,\\\\\"label\\\\\":\\\\\"多人差旅补助\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"showEdit\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"newTemId\\\\\\\\\\\\\":0,\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canEdit\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"approvermodify\\\\\\\\\\\\\":false,\\\\\\\\\\\\\"bizAlias\\\\\\\\\\\\\":\\\\\\\\\\\\\"foodFee\\\\\\\\\\\\\",\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"伙食补助\\\\\\\\\\\\\",\\\\\\\\\\\\\"type\\\\\\\\\\\\\":\\\\\\\\\\\\\"text\\\\\\\\\\\\\",\\\\\\\\\\\\\"required\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"parentId\\\\\\\\\\\\\":11017,\\\\\\\\\\\\\"showList\\\\\\\\\\\\\":\\\\\\\\\\\\\"false\\\\\\\\\\\\\",\\\\\\\\\\\\\"showRule\\\\\\\\\\\\\":false,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"placeholder\\\\\\\\\\\\\":\\\\\\\\\\\\\"请输入伙食补助\\\\\\\\\\\\\"},{\\\\\\\\\\\\\"showEdit\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"newTemId\\\\\\\\\\\\\":1,\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canEdit\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"bizAlias\\\\\\\\\\\\\":\\\\\\\\\\\\\"publicFee\\\\\\\\\\\\\",\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"公杂费\\\\\\\\\\\\\",\\\\\\\\\\\\\"type\\\\\\\\\\\\\":\\\\\\\\\\\\\"text_number\\\\\\\\\\\\\",\\\\\\\\\\\\\"required\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"parentId\\\\\\\\\\\\\":11017,\\\\\\\\\\\\\"showList\\\\\\\\\\\\\":\\\\\\\\\\\\\"false\\\\\\\\\\\\\",\\\\\\\\\\\\\"showRule\\\\\\\\\\\\\":false,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false,\\\\\\\\\\\\\"placeholder\\\\\\\\\\\\\":\\\\\\\\\\\\\"请输入公杂费\\\\\\\\\\\\\"}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"bizAlias\\\\\":\\\\\"foodFee\\\\\",\\\\\"canEdit\\\\\":true,\\\\\"label\\\\\":\\\\\"伙食补助\\\\\",\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"placeholder\\\\\":\\\\\"请输入伙食补助\\\\\",\\\\\"required\\\\\":true,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false,\\\\\"type\\\\\":\\\\\"text\\\\\"},{\\\\\"bizAlias\\\\\":\\\\\"publicFee\\\\\",\\\\\"canEdit\\\\\":true,\\\\\"label\\\\\":\\\\\"公杂费\\\\\",\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"placeholder\\\\\":\\\\\"请输入公杂费\\\\\",\\\\\"required\\\\\":true,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false,\\\\\"type\\\\\":\\\\\"text_number\\\\\"}],\\\\\"placeholder\\\\\":\\\\\"\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"5\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"{\\\\\\\\\\\\\"foodFee\\\\\\\\\\\\\":[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}],\\\\\\\\\\\\\"publicFee\\\\\\\\\\\\\":[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}]}\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11006,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"\\\\\",\\\\\"id\\\\\":15606,\\\\\"label\\\\\":\\\\\"公司垫付\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"type\\\\\\\\\\\\\":\\\\\\\\\\\\\"text_number\\\\\\\\\\\\\",\\\\\\\\\\\\\"bizAlias\\\\\\\\\\\\\":\\\\\\\\\\\\\"platformTotalAmount\\\\\\\\\\\\\",\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"垫付合计\\\\\\\\\\\\\",\\\\\\\\\\\\\"placeholder\\\\\\\\\\\\\":\\\\\\\\\\\\\"合计0个,金额0.00\\\\\\\\\\\\\",\\\\\\\\\\\\\"required\\\\\\\\\\\\\":true}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"bizAlias\\\\\":\\\\\"platformTotalAmount\\\\\",\\\\\"canEdit\\\\\":false,\\\\\"label\\\\\":\\\\\"垫付合计\\\\\",\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"placeholder\\\\\":\\\\\"合计0个,金额0.00\\\\\",\\\\\"required\\\\\":true,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false,\\\\\"type\\\\\":\\\\\"text_number\\\\\"}],\\\\\"required\\\\\":\\\\\"false\\\\\",\\\\\"style\\\\\":\\\\\"5\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11007,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"\\\\\",\\\\\"id\\\\\":15607,\\\\\"label\\\\\":\\\\\"员工垫付\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"type\\\\\\\\\\\\\":\\\\\\\\\\\\\"text_number\\\\\\\\\\\\\",\\\\\\\\\\\\\"bizAlias\\\\\\\\\\\\\":\\\\\\\\\\\\\"personTotalAmount\\\\\\\\\\\\\",\\\\\\\\\\\\\"label\\\\\\\\\\\\\":\\\\\\\\\\\\\"自付合计\\\\\\\\\\\\\",\\\\\\\\\\\\\"placeholder\\\\\\\\\\\\\":\\\\\\\\\\\\\"合计0个,金额0.00\\\\\\\\\\\\\",\\\\\\\\\\\\\"required\\\\\\\\\\\\\":true}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"bizAlias\\\\\":\\\\\"personTotalAmount\\\\\",\\\\\"canEdit\\\\\":false,\\\\\"label\\\\\":\\\\\"自付合计\\\\\",\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"placeholder\\\\\":\\\\\"合计0个,金额0.00\\\\\",\\\\\"required\\\\\":true,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false,\\\\\"type\\\\\":\\\\\"text_number\\\\\"}],\\\\\"required\\\\\":\\\\\"false\\\\\",\\\\\"style\\\\\":\\\\\"5\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"[{\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum},\\\\\\\\\\\\\"companyId\\\\\\\\\\\\\":${__P(orgId,)},\\\\\\\\\\\\\"createTime\\\\\\\\\\\\\":1544595392000,\\\\\\\\\\\\\"createUser\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"feeDetailName\\\\\\\\\\\\\":\\\\\\\\\\\\\"车船费-火车\\\\\\\\\\\\\",\\\\\\\\\\\\\"feeDetailNo\\\\\\\\\\\\\":\\\\\\\\\\\\\"4\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":\\\\\\\\\\\\\"70947692911f4c60b6210fcd478235b5\\\\\\\\\\\\\",\\\\\\\\\\\\\"ownerUserId\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"ownerUserName\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\"}]\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11018,\\\\\"createtime\\\\\":1541382634000,\\\\\"data\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}]\\\\\",\\\\\"id\\\\\":144007,\\\\\"label\\\\\":\\\\\"垫付扣除\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"\\\\\",\\\\\"required\\\\\":\\\\\"false\\\\\",\\\\\"style\\\\\":\\\\\"5\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__threadNum}}]\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11016,\\\\\"createtime\\\\\":1540883126000,\\\\\"data\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__BeanShell(${__threadNum}*2/1.00,)}}]\\\\\",\\\\\"id\\\\\":143941,\\\\\"label\\\\\":\\\\\"收款分配\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"otherprop\\\\\":\\\\\"[{\\\\\\\\\\\\\"canBeDelete\\\\\\\\\\\\\":true,\\\\\\\\\\\\\"canDrag\\\\\\\\\\\\\":false}]\\\\\",\\\\\"otherpropJsonObject\\\\\":[{\\\\\"canEdit\\\\\":false,\\\\\"maxchoose\\\\\":0,\\\\\"maxlen\\\\\":0,\\\\\"required\\\\\":false,\\\\\"showList\\\\\":false,\\\\\"strongcontrol\\\\\":false}],\\\\\"placeholder\\\\\":\\\\\"\\\\\",\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"5\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"[{\\\\\\\\\\\\\"name\\\\\\\\\\\\\":\\\\\\\\\\\\\"${__P(userName,)}\\\\\\\\\\\\\",\\\\\\\\\\\\\"id\\\\\\\\\\\\\":${__P(userId,)},\\\\\\\\\\\\\"amount\\\\\\\\\\\\\":${__BeanShell(${__threadNum}*2/1.00,)}}]\\\\\"},{\\\\\"companyId\\\\\":0,\\\\\"componentid\\\\\":11008,\\\\\"createtime\\\\\":1526371599000,\\\\\"data\\\\\":\\\\\"${__BeanShell(${__threadNum}*2/1.00,)}\\\\\",\\\\\"id\\\\\":15608,\\\\\"label\\\\\":\\\\\"合计金额\\\\\",\\\\\"maxlen\\\\\":20,\\\\\"required\\\\\":\\\\\"true\\\\\",\\\\\"style\\\\\":\\\\\"6\\\\\",\\\\\"type\\\\\":\\\\\"TableField\\\\\",\\\\\"value\\\\\":\\\\\"${__BeanShell(${__threadNum}*2/1.00,)}\\\\\"}],\\\\\"id\\\\\":${__P(ReimbursementTemplateID,)},\\\\\"name\\\\\":\\\\\"${__P(ReimbursementTemplatename,)}\\\\\"}\"}}"}
'''
res_body=""
print("body---->",body)
#res_body=body.replace('"','\\"')
idx=0
#for idx in range(len(body)):
while idx<len(body):
#print(i) #"变为\" (0个\变成1个)
if body[idx]==r'"':
res_body+=r'\"'
idx+=1
#\"变为\\\\\\" (1个\变成6个)
elif body[idx:idx+2]==r'\"':
#print("i>>>>",i)
res_body+=r'\\\\\\"'
idx+=2 #\\\\\"变为\\\\\\\\\\\\\\"(5个\变成14个)
elif body[idx:idx+6]==r'\\\\\"':
#print(1111111111111)
#print(body[idx:idx+6])
#break
res_body+=r'\\\\\\\\\\\\\\"'
idx+=6 #\\\\\\\\\\\\\"变为\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"(13个\变为30个)
elif body[idx:idx+14]==r'\\\\\\\\\\\\\"':
#print(body[idx:idx+14])
#break
res_body+=r'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"'
idx+=14
elif body[idx:idx+3]=='\\u':
res_body+=r'\\u'
idx+=3
else:
#print(5555555555555)
#print(body[idx:idx+6])
res_body+=body[idx]
idx+=1 print(res_body) with open(r"E:\request_body.txt","w",encoding='UTF-8') as fw:
fw.write(res_body)
python 转义json串的更多相关文章
- python中文json串创建与解析
下面代码,举例说明了json如何创建和解析含有中文的json串: #coding=gbk import os import sys reload(sys) sys.setdefaultencoding ...
- python json-json.loads()函数中的字符串需要是严格的json串格式,不能包含单引号
先看下json的dumps()和loads()函数的定义 json.dumps():将一个Python对象编码成JSON字符串.把字典对象转换成json串 json.loads():将JSON格式字符 ...
- json串反转义(消除反斜杠)-- 转载
JSon串在被串行化后保存在文件中,读取字符串时,是不能直接拿来用JSON.parse()解析为JSON 对象的.因为它是一个字符串,不是一个合法的JSON对象格式.例如下面的JSON串保存在文件中 ...
- Python: 自定义类对象序列化为Json串
之前已经实现了Python: Json串反序列化为自定义类对象,这次来实现了Json的序列化. 测试代码和结果如下: import Json.JsonTool class Score: math = ...
- Python: Json串反序列化为自定义类对象
最近刚接触到python,就想到了如何反序列化json串.网上找了一下,大部分都是用json模块反序列化为python数据结构(字典和列表).如果对json模块不了解的参考菜鸟教程.然后我在此基础上将 ...
- 【python】将json串写入文件,并以json格式读取出来
写json--json.dumps 代码: import json #要写入文件的json串(dict格式) result ={', 'https://appapi.xxxx.com/appapi/b ...
- python实现比对两个json串的方法
记录瞬间 前段时间为了解决一些实际问题,引出了要对json字符串进行比对的需求. 觉得有意义,作以简单记录. # 比对数据 def compare_data(set_key, src_data, ds ...
- Python中读取文件中的json串,并将其写入到Excel表格中
Json:JavaScript Objective Notation,是一种轻量级的数据交换格式.Json最广泛的应用是作为AJAX中web服务器和客户端的通讯的数据格式.现在也常用语http请求中, ...
- python 单双引号交替的json串
单双引号交替的json串 1.常见的json串,类似于这种{"isSucess":true, "name":"yoyo", "st ...
随机推荐
- JS补充笔记
<script> 函数: 普通函数: function func(){ } 匿名函数: setInterval("func()",5000); setInterval( ...
- Could not load file or assembly system.data.sqlite.dll or one for it's depedencies
最近做一个winform项目,因为数据库用的表很少,所以用的是轻量级数据库sqlite.sqlite的优点很多,但是他要分两个版本,32位或者64位,不能同时兼容. 我遇到的问题是,我在开发端用的是. ...
- 使用Nginx代理和转发Websocket连接
1.Websocket 简介 WebSocket协议是基于TCP的一种新的网络协议.它实现了浏览器与服务器全双工(full-duplex)通信——允许服务器主动发送信息给客户端. 2.Nginx 简介 ...
- Python实战之网上银行及购物商城
前言:这是初学时写的小项目,觉得有意思就写来玩玩,也当是巩固刚学习的知识.现在看来很不成熟,但还是记录一下做个纪念好了~ 1.名称:网上网上银行及购物商城 2.项目结构: 当时刚接触python啦,哪 ...
- nginx的RPM包制作案例
使用nginx-1.12.2版本的源码软件,生成对应的RPM包软件,具体如下: - 软件名称为nginx - 软件版本为1.12.2 - RPM软件包可以查询描述信息 - RPM软件包可以安装及卸载 ...
- ps:消除锯齿和羽化
我们使用椭圆选框工具,分别关闭和打开消除锯齿(也称抗锯齿),创建两个差不多大的正圆形选区,然后填充黑色看看.怎样快速填充黑色还记得吗?先[X]然后[ALT DELETE].填充之后取消选择[CTRL ...
- ForkJoinPool源码简单解析
ForkJoin框架之ForkJoinTask java 阅读约 62 分钟 前言 在前面的文章"CompletableFuture和响应式编程"中提到了ForkJoinTas ...
- js undefined三目运算
js ajax传值中 "id":$('#id').val(), 如果#id不存在,使用$('#id').val()||‘’,可避免向后台传入undefined
- django 多条数据显示的坑(怪自己)
今天的问题是,一个接口执行了很多次,每次都会在结果表里面记录一条结果信息,在查看接口详情页面,我想只展示一条,然后就进入误区了 第一个是怪自己手残,api_id 被自己写成app_id了 第二个是筛 ...
- Jenkins slave-agent.jnlp 无法安装为服务(install as a service)
问题: 在部署持续集成环境,配置slave节点时遇到一个问题,slave-agent.jnlp可以正常启动运行(不能正常启动的点这里) 但是在保存为系统服务时,slave-agent.jnlp点击[i ...