2014-01-14 67 views
2

我怎么字符串格式里面的字典... 我已经尝试了几件事...没有用 我有这个字典。字典里面的字符串格式?

  PUTVARIABLE = sys.argv[0] 

      {"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \ 
      networkName=endoftimes&[email protected]&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字典...它必须是这种格式,但是,我想要得到一个字符串内

那里,我从命令行或只是脚本之外进入

我在做什么错或不吸入/消化?

回答

4
 {"payload":"http://somewonderfulsite.com/logeventType=pushSceneToChannel& \ 
     networkName=endoftimes&[email protected]&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} 
+0

哇,天哪darnit – sirvon