python2中r开头字符串一行太长,如何写成多行写
         body = r"""{"group_id":%s,"json":"[{\"data\":\"{\\\"Modify\\\":0,\\\"Name\\\":\\\"ExitUnload\\\",\\\"Value\\\":\\\"0\\\",\\\"ValueType\\\":\\\"int\\\",\\\"Details\\\":{\\\"PwdHash\\\":\\\"085a751cdbe0400633a7627b500760cf085a751cdbe0400633a7627b500760cf\\\",\\\"NeedPwd\\\":0}}\",\"bid\":104,\"ver\":27,\"name\":\"ExitUnload\",\"pdata\":\"{\\\"pwd\\\":\\\"\\\"}\",\"inherit\":true},{\"data\":\"{\\\"Modify\\\":0,\\\"Name\\\":\\\"EvlSetting\\\",\\\"Value\\\":\\\"0\\\",\\\"ValueType\\\":\\\"int\\\"}\",\"bid\":104,\"ver\":16,\"name\":\"EvlSetting\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Modify\\\":0,\\\"Name\\\":\\\"QMUUpdateType\\\",\\\"Value\\\":\\\"2\\\",\\\"ValueType\\\":\\\"int\\\",\\\"Details\\\":{\\\"TimeType\\\":2,\\\"Day\\\":1,\\\"Hour\\\":0,\\\"Minute\\\":0,\\\"HourEnd\\\":1,\\\"MinuteEnd\\\":0,\\\"Md5\\\":\\\"\\\",\\\"Url\\\":\\\"\\\",\\\"Version\\\":\\\"\\\"}}\",\"bid\":104,\"ver\":14,\"name\":\"QMUUpdateType\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Modify\\\":1,\\\"Name\\\":\\\"DataReportFlag\\\",\\\"Value\\\":\\\"1\\\",\\\"ValueType\\\":\\\"int\\\"}\",\"bid\":104,\"ver\":15,\"name\":\"DataReportFlag\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Modify\\\":0,\\\"Name\\\":\\\"RTPSelfProtection\\\",\\\"Value\\\":\\\"1\\\",\\\"ValueType\\\":\\\"int\\\"}\",\"bid\":104,\"ver\":18,\"name\":\"RTPSelfProtection\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Details\\\":{\\\"ConfigProxyAddress\\\":\\\"\\\",\\\"ConfigProxyDomain\\\":\\\"\\\",\\\"ConfigProxyPassword\\\":\\\"\\\",\\\"ConfigProxyPort\\\":\\\"\\\",\\\"ConfigProxyUsername\\\":\\\"\\\"},\\\"Modify\\\":0,\\\"Name\\\":\\\"ConfigProxyType\\\",\\\"Value\\\":\\\"0\\\",\\\"ValueType\\\":\\\"int\\\"}\",\"bid\":104,\"ver\":17,\"name\":\"ConfigProxyType\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Details\\\":{\\\"HTTPDownload\\\":1024,\\\"P2PDownload\\\":99999,\\\"P2PUpload\\\":99999,\\\"ClientUploadTimeout\\\":600},\\\"Modify\\\":0,\\\"Name\\\":\\\"P2spSpeedLimit\\\",\\\"Value\\\":\\\"0\\\",\\\"ValueType\\\":\\\"int\\\"}\",\"bid\":104,\"ver\":56,\"name\":\"P2spSpeedLimit\",\"pdata\":\"{}\",\"inherit\":true},{\"data\":\"{\\\"Name\\\":\\\"P2spControl\\\",\\\"Value\\\":\\\"0\\\",\\\"ValueType\\\":\\\"int\\\",\\\"Modify\\\":0,\\\"Details\\\":{\\\"IP\\\":\\\"\\\"}}\",\"bid\":104,\"ver\":55,\"name\":\"P2spControl\",\"pdata\":\"{}\",\"inherit\":true}]"}"""%(group_id)

2个回答

图片说明 用三个单引号或双引号括起来

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!