如何在字典中设置字符串格式... 我已经尝试了一些方法...但无济于事 我有这个字典。
PUTVARIABLE = sys.argv[0]
{"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \
networkName=endoftimes&<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c5259484b534e5779515d55500151597c5159125f5351" rel="noreferrer noopener nofollow">[email protected]</a>&channelName=blastoff& \
sceneType=originalAudio&sceneUrl=%(VARIABLE HERE)s&sceneDescp=uhhuh& \
sceneTag1=ok&sceneTag3=ko& \
sceneTip=22&sceneTipDnom=BTC&networkAvatar=empty& \
timestamp=current_milli_time();"} % PUTVARIABLE
这是一个 json 字典...它必须采用这种格式,但是,我正在尝试在其中获取一个字符串
我从命令行或脚本外部输入
我做错了什么或者没有吸入/消化?
最佳答案
{"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \
networkName=endoftimes&<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e8868d9c9f879a83ad85898184d5858da8858dc68b8785" rel="noreferrer noopener nofollow">[email protected]</a>&channelName=blastoff& \
sceneType=originalAudio&sceneUrl=%(VARIABLE HERE)s&sceneDescp=uhhuh& \
sceneTag1=ok&sceneTag3=ko& \
sceneTip=22&sceneTipDnom=BTC&networkAvatar=empty& \
timestamp=current_milli_time();" % PUTVARIABLE}
关于python - 字典内的字符串格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21110713/