简体   繁体   English

字典中的字符串格式?

[英]string formatting inside a dict?

How do i string format inside a dict... I tried a few things already...to no avail I have this dict. 我如何在字典中使用字符串格式...我已经尝试了几件事...无济于事,我有这个字典。

          PUTVARIABLE = sys.argv[0]

          {"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \
          networkName=endoftimes&networkEmail=me@me.com&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

this is a json dict... it must be in this format but, i'm trying to get a string inside 这是一个json字典...它必须采用这种格式,但是,我正在尝试获取一个字符串

there that i enter from command line or just outside the script 我从命令行或脚本外部输入的内容

what am I doing wrong or not inhaling/digesting ? 我在做什么错或没有吸入/消化?

      {"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \
      networkName=endoftimes&networkEmail=me@me.com&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}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM