2014-01-14 94 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